Global, or close to home.
Share state across your app, or isolate it with createContext. The same approach, at the right scope.
Shared state that feels like useState. Precise subscriptions,
composable selectors, and DevTools your coding agent can use.
Go beyond what the code should do. Inspect the state, run an action, and read back what actually changed. A shorter path from question to evidence.
Explore Agentic DevToolsA small app. An observable state change.
Coding agent → rgsh CLI → local WebSocket → open Chrome DevTools panel → your application. Setup requires the Chrome extension, ws as a development dependency, and the debug import before your stores are created. Keep that import out of production. The preview above is illustrative; it does not connect to an app or run shell commands.
A component should subscribe to what it uses. Select a name, a theme, or a derived value. Unrelated store changes stay unrelated.
Get precise with selectorsThis is about updates from a store subscription. Components can still render for other React reasons.
const useActiveAdmins = useActiveUsers.createSelectorHook( users => users.filter(u => u.role === 'admin'), { isEqual: shallowCompare } );Turn a slice into a reusable hook. Derive another hook from it. Share the same logic across components without copying the selection everywhere.
Explore selector compositionSelector hooks return values directly. Update the source store through its API. Use an equality option for derived arrays.
Start with one store. Add structure only where your application needs it.
Share state across your app, or isolate it with createContext. The same approach, at the right scope.
Add a storage key for browser persistence. Bring validation and migrations when your data evolves.
Explore persistenceGive updates a name. Organize async work and domain logic without changing how components read state.
Work with actionsNo mystery around the small print.
No. A store created with createGlobalState lives outside the component tree. A provider is used when you intentionally choose scoped state with createContext.
An agent that can execute terminal commands, a running development app, the Chrome extension with its panel open, the development debug import, and the ws dependency. The rgsh CLI works with state and actions; it is not browser automation.
Yes. The examples on this website are connected. Open an example, install the Chrome extension, open its DevTools panel, and reload that page. How to try it.
A familiar hook. A precise subscription. A clearer way to build.