useSafeLocalStorage should have an option to saveInLocalStorageOnInitializeIfNotExist #623
peterHakio
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When having multiple useSafeLocalStorage dependent on the same useLocalStorage and there is no value acturally set in local storage, then all of the useSafeLocalStorage will return their default value, which might be different. In order to solve this I want an option to set saveInLocalStorageOnInitializeIfNotExist = true. Which makes sure that the initial value is saved in localStorage and therefore populated to all the users of the useLocalStorage, ensuring consistentcy.
Beta Was this translation helpful? Give feedback.
All reactions