-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local changes #21
Local changes #21
Conversation
45388c4
to
0ee3274
Compare
looking good 👍 Can you add tests / implementation to pass an id / object as filter? hoodie.store.hasLocalChanges('foo')
hoodie.store.hasLocalChanges({id: 'foo'}) |
f3f01f8
to
98ae5f2
Compare
store.add([localObj1, localObj2]) | ||
|
||
.then(function () { | ||
// 'change' event fires after Promist is returned so delay is needed before checking for changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could potentially confuse developers :/ Any way we can avoid that?
Think for example something like hoodie.update(obj).then(render)
and render
would be a sync method that would render the object detail view. If we'd have an store.hasLocalChanges(obj)
in the render method
, it would return false, which is not the expected behavior right after a hoodie.update
call ... hmmmm :/
98ae5f2
to
2a32c20
Compare
d8fd5e3
to
71b06d6
Compare
This PR contains the tests and initial implementation of
.hasLocalChanges
. By listening for internalchange
,push
,andclear
events, updates/destroys a localStorage reference array of ids when needed.Issues
Fixes #19
Fixes #6