-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Hooks: useStorage hook multi tab awareness #2887
Comments
@anud12 I think this can still be done let me take a look. |
Please review my PR: #2888 It now listens to other tabs and there are two new hooks |
Seems good. Another small enhancement (but this is as pedantic as the convenience hooks) is to alter the definition a bit.
To:
Because with that I can use the hook
This will ease the maintenance and refactoring because when i change the valid key options typescript would highlight if and where the key was used. |
I like that change. Just pushed it to my PR. |
Thanks for your great feedback and improvement. Since no PR component is using this hook yet this change is safe to make for 8.2.0 |
Describe the feature you would like to see added
The current implementation for useStorage isn't aware of the
storage
event.Is your feature request related to a problem?
Due to the naming of the hook I expected it to react on changes originating from multiple tabs.
Describe the solution you'd like
The way that i envisioned this functionality is to have 2 hooks rather than 1
useSessionStorage
anduseLocalStorage
and that would've freed the last parameter to be a flag of enabling the reactivity.Sadly with the current implementation without breaking changes the constraints are high on where to add the flag, if the goal in using it should be succinct.
Describe alternatives you have considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: