-
-
Notifications
You must be signed in to change notification settings - Fork 643
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(utils): subscribe method of createJSONStorage should only run in …
…the client (#2585) * fix: prevent calling storage subscribe unless in client * test: add test for getStringStorage method from createJSONStorage to not be called in server * use try-catch * Revert "test: add test for getStringStorage method from createJSONStorage to not be called in server" This reverts commit 71d2fa0. * test: checking localStorage/sessionStorage access with createJSONStorage in server * test: improve checking localStorage/sessionStorage access with createJSONStorage in server * test: use defineProperty for checking localStorage/sessionStorage access with createJSONStorage in server * fix: ts error in new test * improve detecting browser storage access in client * Update src/vanilla/utils/atomWithStorage.ts * patch console.warn for atomWithStorage (in non-browser environment) test --------- Co-authored-by: daishi <daishi@axlight.com> Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
- Loading branch information
1 parent
b236667
commit 48df663
Showing
2 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
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
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