CodeVetter · Repo Unpack · Feature catalog
pmndrs/jotai
The primary user surface is a composable state API rather than an application router or CLI. Primitive and derived atoms support synchronous values, async computations, and custom write actions. Utilities add persistence, state transformations, stream integration, and hydration. The examples and documentation website demonstrate these capabilities and provide search, theme selection, and support inquiries.
- atom overloads support primitive state, read-only derived state, writable derived state, and initial-value atoms with custom writes; primitive writes accept values or updater functions.
- useAtom combines reading and setting; useAtomValue resolves promise values with Suspense, while useAtomValueRaw and useAtomValueRawSync return promise values without consuming them.
- Users can isolate state with Provider, access stores outside React through get/set/sub, hydrate atom arguments once per store unless forced, and run imperative get/set callbacks through useAtomCallback.
- State-control utilities include RESET-aware atoms, computed defaults that can be overwritten and restored, Redux-style reducers, zero-argument refresh, and lazy initial-value factories.
- selectAtom retains the previous slice when equalityFn matches; splitAtom exposes per-item atoms and remove/insert/move actions for writable arrays; freezeAtom wraps reads and self-writes with recursive freezing.
- atomWithStorage supports sync or async adapters, RESET deletion, optional eager initialization, and external subscriptions. atomWithObservable supports streams and subject writes; unwrap exposes fallback values while promises are pending.
- Examples offer editable uppercase text and character counts, async Hacker News item browsing, animated todo filtering and deletion, explicit todo save/load, and nested form/field editing through optics and splitAtom.
- The website provides a tabbed introduction/API overview, slug-based MDX documentation, Algolia search with section hits, a persisted dark-mode toggle, and a professional-support inquiry form.