reactLocalStorage
Easy use localstorage in Reactjs
https://www.npmjs.com/package/reactjs-localstorage
Installation
npm install reactjs-localstorage
or
yarn add reactjs-localstorage
Examples
; reactLocalStorage;reactLocalStorage;reactLocalStorage;reactLocalStorage;reactLocalStorage;reactLocalStorageclear;
Test
npm run test
API Guide
reactLocalStorage.set(key, value)
reactLocalStorage.get(key, deafultValue=undefined, silent=true)
reactLocalStorage.setObject(key, object)
reactLoacStorage.getObject(key, defaultValue={}, silent=true)
reactLocalStorage.remove(key)
reactLocalStorage.clear()
silent:
true
: Will not throw exception instead will return defaultValuefalse
: Will throw exception
License
MIT