Examples
Practical examples demonstrating state-sync patterns.
Framework examples
| Example | Stack | Description |
|---|---|---|
| React + Zustand | React, Zustand, BroadcastChannel | Shopping cart synced across browser tabs |
| Vue + Pinia + Tauri | Vue 3, Pinia, Tauri v2 | Settings panel synced across Tauri windows |
| Tauri + Any Store | Tauri v2, Any framework | Multi-window sync with any state manager |
| Electron + Any Store | Electron, Any framework | Multi-window sync with any state manager |
Core patterns
| Example | Description |
|---|---|
| Source of truth | In-memory transport, revision gate, invalidation cycle |
| Throttling & coalescing | debounceMs, throttleMs, leading/trailing, visual timeline |
| toState mapping & key filtering | Backend → frontend transform, pickKeys/omitKeys, ctx |
| Persistence stack | Compression, TTL, cross-tab sync, cached load |
| Structured logging | JSON logger, error metrics, observability |
| Error handling & retry | Graceful degradation, automatic retry, UI indicators |
| Persistence with migrations | Schema versioning, data migration, validation |
See also
- Quickstart — minimal setup with code snippets for each adapter
- Writing state — patterns for the write path (UI → backend)
- Custom transports — build your own subscriber/provider
