svelte-persistent-store
- Persists Svelte stores in
localStorage
orsessionStorage
for state preservation across page reloads - Designed specifically for Svelte applications (not framework-agnostic)
- Provides persistent versions of Svelte's core store types:
writable
readable
derived
- Uses JSON serialization to store values since web storage only accepts strings
- Key features:
- Simple API matching Svelte's native store interface
- Automatic synchronization between storage and store state
- Supports both localStorage (persistent) and sessionStorage (temporary) backends
Target audience: Svelte developers who need to maintain application state across page refreshes or browser sessions.
Storage interface specification
Svelte store documentation
svelte
Author
Featured Stories
No featured articles here. Navigate to an article, then pick the Feature on menu button