【文件属性】:
文件名称:svelte-local-storage-store:将pubsub添加到localStorage
文件大小:89KB
文件格式:ZIP
更新时间:2021-04-29 03:16:01
localstorage svelte pubsub JavaScript
svelte本地存储商店
将发布/订阅添加到本地存储的商店。
安装
npm install svelte-local-storage-store
用法
定义商店:
import { writable } from 'svelte-local-storage-store'
// First param `preferences` is the local storage key.
// Second param is the initial value.
export const preferences = writable ( 'preferences' , {
theme : 'dark' ,
pane : '50%' ,
...
} )
然后,当您想使用商店时:
import { get } from 'svelte/store'
import { preferenc
【文件预览】:
svelte-local-storage-store-master
----rollup.config.js(473B)
----package.json(944B)
----test()
--------localStorageStore.test.js(2KB)
----src()
--------index.js(675B)
----.eslintrc.js(691B)
----.gitignore(30B)
----README.md(950B)
----yarn.lock(222KB)
----.tool-versions(14B)
----babel.config.js(148B)