Skip to content
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

Storage event support #104

Closed
ghost opened this issue Mar 16, 2014 · 14 comments
Closed

Storage event support #104

ghost opened this issue Mar 16, 2014 · 14 comments

Comments

@ghost
Copy link

ghost commented Mar 16, 2014

I checked the code, but I haven't found support for the storage event. Maybe I just missed it, but if not, then this is a feature request...

@tofumatt
Copy link
Member

You're right, I actually didn't even know there was a storage event! I'm open to adding support for it.

@ghost
Copy link
Author

ghost commented Mar 17, 2014

@ghost
Copy link
Author

ghost commented Mar 17, 2014

I don't think the others have something like that, so I think you can emulate it only by short polling the databases and adding a lastModified timestamp to them.

@ghost
Copy link
Author

ghost commented Mar 17, 2014

https://developer.mozilla.org/en-US/docs/Web/API/window.postMessage?redirectlocale=en-US&redirectslug=DOM/window.postMessage
So if you have this postMessage then you don't need to ping the db from every opened window, just from a single one and after that share the information with postMessage.

@ghost
Copy link
Author

ghost commented Mar 17, 2014

Other possible solution to share the info between tabs is using a shared webworker...
So I think you should only poll for the last change timstamp from a single window, and share that information with the other tabs with shared webworkers or window.postMessage, or some other intertab communication channels if it is possible... If the db polling window is closed, then the other windows should have an intertab timeout and after that timeout they can automatically choose another db polling window.

@tofumatt tofumatt added this to the 1.0 Stable milestone Apr 12, 2014
@tofumatt tofumatt modified the milestones: 1.0-rc, 1.1 getItems(); keys() Oct 8, 2014
@tofumatt tofumatt modified the milestones: 1.3 getItems(); keys(), Work week (April) May 3, 2016
@tofumatt tofumatt mentioned this issue Nov 14, 2016
@TheNeikos
Copy link

Is this still a thing?

@tofumatt
Copy link
Member

tofumatt commented Feb 4, 2017

I don't think there's any interest in it at this point and I don't see the appeal, so I say we close it. If anyone disagrees let me know 😄

@tofumatt tofumatt closed this as completed Feb 4, 2017
@TheNeikos
Copy link

Well, one thing that it is really useful for would be for things like these: https://github.com/rt2zz/redux-persist-crosstab

This would make it easier to 'just' make it work, instead of having to use localStorage.

@tofumatt
Copy link
Member

tofumatt commented Feb 4, 2017

Huh, interesting.

Okay, I'll keep it open then. We haven't had any traction on fixing it but after seeing that use-case I'd totally accept a patch! 😄

@tofumatt tofumatt reopened this Feb 4, 2017
@thgreasi
Copy link
Member

thgreasi commented Feb 4, 2017

Since we already have https://github.com/localForage/localForage-observable , should this ticket just have cross-tab notification as a pending?

@tofumatt
Copy link
Member

tofumatt commented Feb 4, 2017

Oops, I forgot about that. Yeah, looks like that's all this is really missing.

@thgreasi
Copy link
Member

thgreasi commented Feb 4, 2017

Just opened localForage/localForage-observable#5 to track the cross-tab support. @tofumatt should we close this one and #244 and move the discussion to the plugin's repo?

@tofumatt
Copy link
Member

tofumatt commented Feb 4, 2017

Yeah, I think that's good.

@TheNeikos, please follow localForage/localForage-observable#5 for further updates on this 😄

@tofumatt tofumatt closed this as completed Feb 4, 2017
@thgreasi
Copy link
Member

thgreasi commented Feb 9, 2017

Just opened localForage/localForage-observable#6 for this. Any feedback would be great and could help releasing it during the weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants