useLocalStorage
accepts akey
and uses it to set and retrieve the value in local storageuseLocalStorage
accepts adefaultValue
used to set the value of the ref when nothing is currently set under the provided key in localStorage.- The composable returns a ref called value that holds the value from localStorage
- The returned value updates when the related data in localStorage updates
- The data in localStorage should updates when the ref value updates
- When you type in the input in the running app, the value syncs to local storage (and vice versa)