ls-store
v1.0.0
Published
A super-simple localStorage-persisted Svelte store
Downloads
4
Readme
LS-Store
A super-simple localStorage-persisted Svelte store
Usage
Because it uses the default Svelte stores under-the-hood, all you have to do is change your imports from:
import { writable } from "svelte/store";
export const counter = writable(0);
to:
import { persisted } from "ls-store";
export const counter = persisted("localStorageItemKey", 0);