npm.io
1.3.4 • Published 2 months ago

@nanostores/persistent

Licence
MIT
Version
1.3.4
Deps
0
Size
14 kB
Vulns
0
Weekly
0
Stars
379

Nano Stores Persistent

A smart store for Nano Stores state manager to keep data in localStorage and synchronize changes between browser tabs.

  • Small. From 296 bytes (minified and brotlied). Zero dependencies. It uses Size Limit to control size.
  • It has good TypeScript.
  • Framework agnostic. It supports SSR. localStorage can be switched to another storage.
import { persistentAtom } from '@nanostores/persistent'

export const $locale = persistentAtom('locale', 'en')

Made at Evil Martians, product consulting for developer tools.


Docs

Read full docs here.

Keywords