README
Safe Storage
Internal package
provides safe versions of localStorage and sessionStorage that don't throw because of browser issues like safari in private mode.
exposes the same storage API as the browser's API -
- https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
- https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage
In case storage isn't supported, the same API is available but will be replaced with no-op versions.
The best place to get started is at our: React-Uploady Documentation Website
Installation
#Yarn:
$ yarn add @rpldy/safe-storage
#NPM:
$ npm i @rpldy/safe-storage
Important!
All exports of this package are considered internal API and may change/disappear in any version: patch/minor/major
Example
import { safeLocalStorage } from "@rpldy/safe-storage";
safeLocalStorage.setItem("test", "value");
const stored = safeLocalStorage.getItem("test");
safeLocalStorage.removeItem("test");