3.1.2 • Published 4 years ago
@feizheng/next-store v3.1.2
next-store
Storage for weapp based on next.
installation
npm install -S @feizheng/next-store
apis
api | params | default | description |
---|---|---|---|
$ | (name, purify) | - | Select local/session engine instance. |
config | (options) | - | Select local/session engine instance. |
usage
import NxStore from '@feizheng/next-store';
// init with namespace(prefix)
const store = new NxStore({ prefix:'abc', purify: true });
// set
store.local = { name:'nx', github:'afeiship', items:['next','gem','nx']}
// get
const { name } = store.local;
// get/gets/set/sets/del/dels/clear
store.$('local').del('nx');
store.$('local', true).del('xxx');
store.config({ prefix:'myprefix'})