storage-cover
v1.0.4
Published
web storage wrapper for continuous web application in all browsers
Downloads
3
Maintainers
Readme
storage-cover
Web Storage might not work because its implementation(e.g. incognito mode) is different by browsers. So developers should take these different implementations into account.
storage-cover
is great solution for resolving this issue. storage-cover
wraps Web Storage to prevent unexpected error and keep your web application continuous.
- zero dependencies
- easy to use
- support SSR
import { wrapLocalStorage, wrapSessionStorage } from "storage-cover";
export const localStorage = wrapLocalStorage();
export const sessionStorage = wrapSessionStorage();
localStorage.set("SOME_KEY", "Hello, World!");
console.log(localStorage.get("SOME_KEY")); // Hello, World!