Does the world need another state management library? Probably not, but if you've been interested in XState, you're going to want to check this one out.
XState Store is a simple & tiny state management library largely inspired by XState. If you just need a way to update data in a store and subscribe to changes in the store, XState Store is for you. It is:
- Extremely simple. Provide initial context and transition functions to the
createStore(…)
function, and you're good to go. - Extremely small. Less than 1kb minified and gzipped.
- XState compatible. Shares actor APIs with XState, making integration/migration easy if (when) you need to handle more complexity.
- Extra type-safe. Written in TypeScript, it provides strong event and snapshot types, automatically inferred from your context and transitions.
- Event-based. Works just like XState; send events to trigger transitions.
- Immer ready. Easily add Immer for "mutable" context updates with
createStoreWithProducer(producer, …)
.