How to use this library with sessionStorage ? #26
-
Since the API of localStorage and sessionSession storage is so similar, |
Beta Was this translation helpful? Give feedback.
Answered by
niketpathak
Sep 1, 2023
Replies: 1 comment
-
The version 2.5.0 allows you to configure the library to be used with sessionStorage. import ls from 'localstorage-slim';
// simply set the config option to use sessionStorage instead of localStorage
ls.config.storage = sessionStorage;
ls.set("test", "data"); // This will be stored in sessionStorage. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
niketpathak
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The version 2.5.0 allows you to configure the library to be used with sessionStorage.