-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix(#785): update useStorage to use createGlobalState #1025
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Ward <wardoosterlijnck@gmail.com>
# [13.27.0](streamich/react-use@v13.26.5...v13.27.0) (2020-03-03) ### Features * **useSet:** add toggle a method ([streamich#968](streamich#968)) ([477614f](streamich@477614f))
nspaeth
force-pushed
the
pr/fix-785
branch
6 times, most recently
from
March 6, 2020 18:39
0ca1c4c
to
635f2f3
Compare
fix: 🐛 improve how text is dropped in useDrop hook
## [15.2.3](streamich/react-use@v15.2.2...v15.2.3) (2020-06-13) ### Bug Fixes * 🐛 improve how text is dropped in useDrop hook ([b2f46d1](streamich@b2f46d1))
## [15.2.4](streamich/react-use@v15.2.3...v15.2.4) (2020-06-13) ### Bug Fixes * doesn't unlock the body on unmount ([1ead4ef](streamich@1ead4ef))
## [15.2.5](streamich/react-use@v15.2.4...v15.2.5) (2020-06-15) ### Bug Fixes * bump react-universal-interface ([1540c1a](streamich@1540c1a))
Better to use two-variables exchange than `useEffect` with new function on each render.
feat(usePrevious): reworked the hook, now it is more memory-efficient.
# [15.3.0](streamich/react-use@v15.2.5...v15.3.0) (2020-06-19) ### Features * **usePrevious:** reworked the hook, now it is more memory-efficient. ([8c6f467](streamich@8c6f467))
This commit adds support for functional updates to align with the React.useState API. Type definitions are updated to match useState. This might break existing code that expects functions to be held in the global state, rather than applied as an update. This change may also cause new type errors.
Makes the call synchronous to avoid race conditions, and works with SSR. See comment at: streamich#1060 (comment)
…es and folder --uses the base storage, that we can re-used for localStorage and sessionStorage, because they have he same signature -Added the sessionStorage unit test -Update the docs that describe about the config changes, for raw, serializer, de-serializer
Fixes streamich#785 - useLocalStorage not updating if many components watch the same key Previously pr streamich#786 addressed this issue by ensuring that other components watching the key would see new updates, however, those updates would not be rendered until something else triggered a re-render. This pr resolves that issue. This pull request depends on pull requests streamich#1021 streamich#979
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #785 - useLocalStorage not updating if many components watch the same key
Previously pr #786 addressed this issue by ensuring that other components
watching the key would see new updates, however, those updates would not be
rendered until something else triggered a re-render. This pr resolves that issue.
This pull request depends on pull requests #1021 #979
Type of change
Breaking change (fix or feature that would cause existing functionality to not work as before)Checklist
yarn test
)yarn lint
). Fix it withyarn lint:fix
in case of failure.yarn lint:types
).