Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hoseungme/storage-cover

Web storage wrapper for continuous web application in all browsers
https://github.com/hoseungme/storage-cover

javascript localstorage sessionstorage storage typescript web webstorage

Last synced: 16 days ago
JSON representation

Web storage wrapper for continuous web application in all browsers

Awesome Lists containing this project

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

```typescript
import { wrapLocalStorage, wrapSessionStorage } from "storage-cover";

export const localStorage = wrapLocalStorage();
export const sessionStorage = wrapSessionStorage();
```

```typescript
localStorage.set("SOME_KEY", "Hello, World!");
console.log(localStorage.get("SOME_KEY")); // Hello, World!
```