Skip to content

Web storage wrapper for continuous web application in all browsers

Notifications You must be signed in to change notification settings

hoseungme/storage-cover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!