-
Notifications
You must be signed in to change notification settings - Fork 177
Add localstorage event handler #32
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
Add localstorage event handler #32
Conversation
|
Looking at the travis log, it seems that there is some credential issue preventing the tests from running rather than test failures in this branch. |
|
Thanks again! Will try to look at the PR this week :) |
|
Have you had a chance to look at this, @danielstjules? |
|
I would also like to see this or a similar feature if possible. Thank you for your time! |
|
Unlike localStorage events, it looks like these would fire to all clients, including the source of the change https://html.spec.whatwg.org/multipage/webstorage.html#the-localstorage-attribute |
|
@danielstjules: The Hub uses the localStorage event, so the client that initiates the change will not get an event since the hub does not. Also, if multiple clients somehow use the same hub window, they won't get any updates when the other clients update the data. |
|
Since this was a pretty old PR, I didn't want to bother you with changes. I've squashed it and am taking it over in another branch. Thank you so much! :) |
We needed to be updated when another window changed a value, so this PR implements forwarding
storageevents from the hub to the client.Resolves initial request in #19. It tries to behave like the storage event as much as possible, rather than implementing own event for different types of requests. This also means that no events will be sent from hubs that actually make the changes.
Feedback appreciated, I'm not sure if I've followed all conventions of the library or if the API is the best available.