React State Management Library

React State Management Library

github.com

2

About this website

A minimalist yet powerful state management solution for React applications that provides a hooks-based API without requiring providers, context wrappers, or action dispatchers. State is created using a single create function that returns a custom hook, and components subscribe to specific slices of state using selector functions, ensuring they only re-render when the exact data they depend on changes. This selector pattern eliminates the zombie child problem that affects other hook-based state managers, where child components read stale state after a parent re-render. The library also correctly handles React concurrent features and context loss between mixed renderers, making it one of the few state managers in the React ecosystem that addresses all three common pitfalls. Store creation follows a flux-like pattern with a set function that merges state updates, supporting both direct value assignment and function-based updates that receive the previous state. The API supports middleware for persisting state to localStorage or sessionStorage, logging state changes, immutability enforcement through immer integration, devtools integration for Redux DevTools time-travel debugging, and subscribe-with-selector for fine-grained external subscriptions. TypeScript support is first-class, with type inference for state shape and action signatures. Stores can be composed and shared across multiple React roots or even used outside React components. Async operations work naturally without additional wrappers, and the library weighs only 1.1 kilobytes gzipped with no external dependencies.

Tags & Categories

Statistics

2
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!