secure-ls
secure-ls copied to clipboard
secure-ls ( v.^1.2.6") can't find variable localStorage
I am trying to use secure-ls to encrypt local data of my Parse Server Application in a react-native project. when typing the following two lines, I get the error "secure-ls can't find variable localStorage":
import SecureLS from 'secure-ls';
const ls = new SecureLS({ isCompression: false });
Could you tell me how to fix this error?
https://github.com/softvar/secure-ls/blob/b2d92feeeb0de93f8aebed83750dd5a30fd02d0e/src/index.js#L39
试试自己改一下这里?我想使用 sesstionStorage ,而不是 localStorage.
只要覆盖以下 api clear setItem getItem remove 应该就可以直接用了