@nanostores/persistent

A tiny persistent store for Nano Stores state manager

Usage no npm install needed!

<script type="module">
  import nanostoresPersistent from 'https://cdn.skypack.dev/@nanostores/persistent';
</script>

README

Nano Stores Persistent

A tiny persistent store for Nano Stores state manager. It stores data in localStorage and synchronize changes between browser tabs.

  • Small. from 308 bytes (minified and gzipped). 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')
Sponsored by Evil Martians

Docs

Read full docs on GitHub.