What problem does it solve?
State management in modern UI apps often struggles with brittle mutations and scattered updates. state-ref provides proxy-based stores and lens-pattern updates to enable fine-grained, safe reactivity with automatic dependency tracking.
Core Features & Use Cases
- Create stores with createStore and subscribe with watch to react to changes.
- Combine multiple stores with combineWatch and derive computed values with createComputed.
- Framework connectors for React, Preact, Vue, Svelte, and Solid; manual-sync patterns via createStoreManualSync.
- Encourage safe mutation practices: read through the value property, use AbortController for cleanup, and leverage immutable patterns with copyable and lens.
Quick Start
Install state-ref, create a store with createStore, and attach a watch callback to react to changes.