ls-store

1.0.0 • Public • Published

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);

Readme

Keywords

none

Package Sidebar

Install

npm i ls-store

Weekly Downloads

2

Version

1.0.0

License

none

Unpacked Size

3.26 kB

Total Files

6

Last publish

Collaborators

  • dodiameer