Getting Started
“Two and eight” — Cockney rhyming slang for “state”.
Introduction
A lightweight JavaScript / TypeScript state management library that uses a class-based store.
Key features include:
- Action / commit based state flow.
- Built-in subscription system for reactive updates.
- Flexible state reset functionality for entire state or specific fields.
- Type-safe state management.
- Minimal boilerplate.
Installation
Create a store
You store is a class, and turning it into a React hook is as easy as passing it
to the createReactStore
utility.
Import into your React components
The hook provides flexible state management that can be used directly in any component. When you modify the state, the consuming component automatically re-renders to reflect those changes.