Skip to content
Persist
Esc
navigateopen⌘Jpreview

Recipes

Copy-paste Persist patterns — composition, options, stores, cross-tab, Standard Schema, React Native, Node fs.

Composable patterns over the three seams. Start with Composition for encrypt/compress stacks; use the pages below for options and store adapters.

Recipe Topic
Composition Encrypt, compress, legacy IDB string payloads, namespaced stores
Options Clear-all, partialize, merge, retryWrite, throttleMs, maxAge, buster, migrate, skipPersist
Wrapping stores zustand, jotai, valtio, mobx, pinia, redux, custom PersistableSource
Cross-tab localStorage sync and BroadcastChannel over IndexedDB
Standard Schema Schema-gated persist with any ~standard library
React Native AsyncStorage, MMKV, Expo Secure Store
Node fs Server / SSR / CLI file-backed storage

Caveats that matter per backend: async backends (IDB, AsyncStorage, Secure Store) can’t settle hydration before first paint → gate UI on a framework adapter; sessionStorage is per-tab (crossTab is meaningless); identityCodec never with string-only backends.

Last updated on July 22, 2026

Was this page helpful?