Jotai
Jotai integrates through createJotaiStoreAdapter — a thin bridge between an atom and the store instance that owns it, or a custom adapter handling both full array hydration and live sparse delta updates.
- An atom created with atom() and a store instance from createStore() — see Jotai's docs if you're new to it
- Familiarity with register() — see api/register
A plain Jotai atom and store
Registering with createJotaiStoreAdapter
createJotaiStoreAdapter and pass the result as store — the adapter takes the atom first, then the store.Why Jotai needs an adapter
setState of its own to fall back to — it's a definition, not a container. The adapter exists purely to give dispatchToStore's fallback path something to call.Handling sparse updates and single delta frames
CREATE, sparse UPDATE, and DELETE) alongside initial full array hydration payloads. Write a custom adapter object to handle both intake shapes:createJotaiStoreAdapter and perform the sparse merge inside hydrateState:One store instance, everywhere
<Provider>, the store passed to it and the store passed to createJotaiStoreAdapter (or custom adapter) must be the exact same instance.There is no error thrown if the Provider's store and the adapter's store diverge — Flux writes to one atom graph, your components read from another, and the UI simply never updates. If a Jotai-registered channel looks like it is not dispatching, check this first.
Deleting a record: online vs offline
DELETE frame to filter the atom. The remaining piece is triggering that delete from your UI in a way that survives being offline at the moment it happens.If a record only ever existed as an un-replayed queued create, there is nothing server-side to delete — remove it locally and purge the pending create instead of queuing a DELETE that would 404 on replay.
Combining with scope
scope exactly like any other state manager — the adapter layer has no awareness of multi-tenant scoping at all.Local writes: dispatchLocalUpdate()
flux.dispatchLocalUpdate(channel, data, options?) routes a server-confirmed write through the adapter's own setState() — identical to how bootstrap and realtime frames already reach the atom via store.set().Only call dispatchLocalUpdate after the server has accepted the write. It persists to IDB and mirrors to other open tabs immediately — it is a confirmed-write dispatch, not an optimistic one.
Jotai vs. the other adapters
Because Jotai manages atomic dependency graphs, updating individual atom values via the adapter only re-renders the specific leaf components subscribed to those atoms, bypassing broader context tree re-renders during high-frequency ingestion.
For Zustand, Flux's native option, see state_managers/zustand. For Redux, see state_managers/redux. For Stunk, see state_managers/stunk. For the full offline write queue, see core_concepts/offline_queue. For every other registration field alongside store, see api/register.