文件名称:state-persistor:根据密钥写入,读取或清除本地存储
文件大小:70KB
文件格式:ZIP
更新时间:2024-06-05 15:16:04
JavaScript
@ codewell / state-persistor 带有本地存储的前端应用程序的简约状态保持器。 安装 npm install @codewell/state-persistor 基本用法 import { saveState , loadState , purgeState } from '@codewell/state-persistor' ; const state = { } ; // Some state const STORAGE_KEY = 'myCoolUniqueApplicationStorageKey' ; // Unique key to store the state in localstorage // Persist the state saveState ( state , STORAGE_KEY ) ; // Get the persisted
【文件预览】:
state-persistor-master
----rollup.config.js(823B)
----.github()
--------workflows()
----src()
--------saveState.js(406B)
--------purgeState.js(280B)
--------loadState.js(450B)
--------index.js(159B)
----.npmignore(39B)
----LICENSE(1KB)
----.prettierrc(0B)
----README.md(596B)
----tests()
--------index.test.js(687B)
----.gitignore(24B)
----index.js(139B)
----package-lock.json(289KB)
----package.json(1KB)