Skip to content

How to use this library with sessionStorage ? #26

Closed Answered by niketpathak
niketpathak asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by niketpathak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant