# Data flow — pmndrs/jotai

> Canonical page: https://codevetter.com/unpack/jotai/data-flow

# Data flow — pmndrs/jotai

Scanned commit 6abd0ae3365e02ab432fba4b6e8e6f00aafbf508 (2026-09-29). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Atom objects identify state, while stores own values, dependency epochs, and subscriptions. Reads establish dependencies and reuse cached results when their validity checks succeed. Writes propagate through custom atom actions, invalidate affected state, recompute dependencies, and notify subscribers. Promise, storage, documentation-indexing, and contact adapters introduce distinct external boundaries.
- An initial primitive value enters atom.init; the first store read creates AtomState and initializes its value through the self-getter. The same atom configuration can therefore have separate state in separate stores. — [src/vanilla/atom.ts#L110-L120](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/vanilla/atom.ts#L110-L120) [src/vanilla/internals.ts#L515-L534](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/vanilla/internals.ts#L515-L534) [src/vanilla/internals.ts#L762-L773](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/vanilla/internals.ts#L762-L773) [docs/core/provider.mdx#L39-L39](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/docs/core/provider.mdx#L39-L39)
- readAtomState reuses initialized state when a mounted atom is not invalidated or its validation epoch equals the store epoch; otherwise it recursively compares recorded dependency epochs before recomputing. — [src/vanilla/internals.ts#L698-L742](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/vanilla/internals.ts#L698-L742)
- A derived read's getter records dependency atom epochs, removes those atoms from the stale-dependency set, and registers pending dependents for promises; stale dependencies are pruned synchronously or when the read promise settles. — [src/vanilla/internals.ts#L744-L792](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/vanilla/internals.ts#L744-L792) [src/vanilla/internals.ts#L765-L784](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/vanilla/internals.ts#L765-L784) [src/vanilla/internals.ts#L820-L831](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/vanilla/internals.ts#L820-L831)
- writeAtomState supplies a getter and setter to atom.write; self-writes update initialized state, advance the store epoch when the atom epoch changes, and invalidate dependents, while writes to other atoms recurse through their write functions. — [src/vanilla/internals.ts#L897-L939](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/vanilla/internals.ts#L897-L939)
- Changed mounted or pending dependents are traversed for topological recomputation; flushCallbacks deduplicates listeners and lifecycle callbacks, drains newly generated work, and aggregates callback errors. — [src/vanilla/internals.ts#L555-L598](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/vanilla/internals.ts#L555-L598) [src/vanilla/internals.ts#L613-L677](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/vanilla/internals.ts#L613-L677) [src/vanilla/internals.ts#L855-L874](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/vanilla/internals.ts#L855-L874)
- React's ordinary raw hook reads store.get into reducer state and subscribes in an effect; Object.is suppresses unchanged reducer values. Async values pass through createContinuablePromise, whose abort handler follows replacement promises before useAtomValue consumes them. — [src/react/useAtomValueRaw.ts#L52-L80](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/react/useAtomValueRaw.ts#L52-L80) [src/react/continuablePromise.ts#L24-L54](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/react/continuablePromise.ts#L24-L54) [src/react/useAtomValue.ts#L66-L75](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/react/useAtomValue.ts#L66-L75)
- atomWithStorage reads on mount and optionally at construction, feeds subscription updates into baseAtom, and writes memory before storage.setItem/removeItem. createJSONStorage translates values through JSON and filters browser storage events by storage area and key. — [src/vanilla/utils/atomWithStorage.ts#L119-L144](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/vanilla/utils/atomWithStorage.ts#L119-L144) [src/vanilla/utils/atomWithStorage.ts#L172-L184](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/vanilla/utils/atomWithStorage.ts#L172-L184) [src/vanilla/utils/atomWithStorage.ts#L222-L260](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/src/vanilla/utils/atomWithStorage.ts#L222-L260)
- Website MDX metadata/body become Algolia document and heading records, then search queries refine the Docs index and hits navigate to /docs/{slug}. Support form data separately becomes a JSON POST and a Postmark text email with the submitted address as ReplyTo. — [website/gatsby-config.js#L31-L75](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/website/gatsby-config.js#L31-L75) [website/src/components/search-modal.js#L81-L98](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/website/src/components/search-modal.js#L81-L98) [website/src/components/support.js#L19-L42](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/website/src/components/support.js#L19-L42) [website/api/contact.js#L12-L31](https://github.com/pmndrs/jotai/blob/6abd0ae3365e02ab432fba4b6e8e6f00aafbf508/website/api/contact.js#L12-L31)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
