cassiozen/useStateMachine
The <1 kb state machine hook for React observed · 2026-08-28
Health v2 · maintenance only
23/100
- Activity 0
- Release rhythm 8
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 2000
- days_rel: n/a
- days_push: 863
- n_releases_24m: 0
Adoption not part of the score
2402 stars · 48 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A tiny (<1 kb) React hook for finite state machines, built as a thin wrapper around useReducer and useEffect. It supports entry/exit effects, guarded transitions, and extended state (context) with strong automatic TypeScript type inference.
Use cases
- manage component state as a finite state machine in react
- add state-driven ui toggling to a react app
- orchestrate async data fetching with retries in react
- model form flows with typed events and context
- find a lightweight xstate alternative for react hooks
When to choose
- you want a minimal, dependency-free state machine in a React app
- you value excellent TypeScript inference and a tiny bundle size
- your state logic fits simple states, transitions, and effects
When to avoid
- you need hierarchical or parallel state machines like XState offers
- you're not using React
- you need visualization tooling or a large state chart ecosystem
Facets
library · maturity stable
state-management frontend-framework frontend web-development developer-tools cross-platform react-hook finite-state-machine typescript tiny-library xstate-alternative nodejs web-server
1 source
- readme: https://github.com/cassiozen/useStateMachine · fetched 2026-08-28 · 9b351083ea1c
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| cassiozen/useStateMachine | main | 23 |
For agents
markdown · JSON · MCP: product_card(name="cassiozen/useStateMachine")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem