@openish-u/storagefy
v3.0.2
Published
A utility to store data in the browser
Maintainers
Readme
storagefy
LocalStorage helper
Are you reading this on npm? Check out the full and updated documentation on GitHub.
npm i @openish-u/storagefyMotivation
Have you needed to create a localStorage service? I guess you have. Thestoragefy helper resolves it at once.
How to use it
get data
import { storageService } from 'utility-storagefy';
// JS
const data = storageService.get('myObjetct')
// TS
interface ICustomType {}
const data = storageService.get<ICustomType>('myObjetct')set data
import { storageService } from './storagefy';
// JS
const data = storageService.set('myObjetctKey', {name: 'obj'})
// TS
interface ICustomType {}
const data = storageService.set<ICustomType>('myObjetctKey', {name: 'obj'})