Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

touch item #158

Merged
merged 3 commits into from
Mar 16, 2018
Merged

touch item #158

merged 3 commits into from
Mar 16, 2018

Conversation

sashei
Copy link
Contributor

@sashei sashei commented Mar 14, 2018

resolves #152

@sashei sashei force-pushed the 152-update-last-used branch 2 times, most recently from b7d51d2 to c850655 Compare March 15, 2018 22:41
@sashei sashei force-pushed the 152-update-last-used branch from c850655 to 407fcba Compare March 15, 2018 22:44
@sashei sashei changed the title touch item wip touch item Mar 15, 2018
Copy link
Contributor

@jhugman jhugman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far!


let jsonItem = try self.parser.jsonStringFromItem(item)

return self.webView.evaluateJavaScript("\(self.dataStoreName).touch(\(jsonItem))")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I… don't… understand… this code.

Doesn't evaluateJavascript return void? Oh, god it, Rx monkey patches.

self = date
} else {
return nil
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Could you document some of the sample strings this is expected to handle?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the test count as documentation here? Or are you saying that I could include more cases in the spec file to be more thorough?

.map { items in
guard let id = item.id else {
return items
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@@ -68,4 +68,14 @@ class SwiftInteropDataStore extends DataStoreModule.DataStore {
}
})
}

async touch(item) {
return super.touch(item).then( function(updatedItem) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Use

updatedItem => {}

instead of function.

@sashei sashei merged commit 4b670cd into master Mar 16, 2018
@sashei sashei deleted the 152-update-last-used branch March 16, 2018 21:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Touch item in DataStore after copy / paste
2 participants