Use memory,session storagy or local storage to cache things.
# NPM
npm install @awey/dache --save
# Yarn
yarn add @awey/dache
import Dache from '@awey/dache'
const dache = new Dache('local', 'myDache')
dache.set('username', 'Tom')
console.log(dache.get('username'))
new Dache(type: 'memory' | 'session' | 'local', name: string) => Dache
: init a Dache instancedache.get(key: string) => any
: retrieve a value by key from cachedache.set(key: string, value: any) => void
: store a value by key to cachedache.remove(key: string) => void
: delete a value by key from cachedache.clear() => void
: clear all values in cachedache.has(key: string)
: determines whether a key exists(not null)dache.is(key: string, value: any)
: determines whether a value is equal(===) to the specified value