Created
May 13, 2022 15:07
-
-
Save SebastianUdden/73ec7f999248252c85d11e4471c52d4f to your computer and use it in GitHub Desktop.
How to save and get localStorage data
This file contains hidden or 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
| export const getSaved = () => | |
| JSON.parse(localStorage.getItem("new-tag") || "{}"); | |
| export const save = (value) => | |
| localStorage.setItem("new-tag", JSON.stringify(value)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment