Skip to content

@statesync/jotai


@statesync/jotai / JotaiApplyMode

Type Alias: JotaiApplyMode

ts
type JotaiApplyMode = "patch" | "replace";

Defined in: jotai.ts:51

The strategy used to apply incoming snapshot data to the Jotai atom.

  • 'patch' — Non-destructive shallow merge. The adapter uses the store's updater form store.set(atom, prev => ({ ...prev, ...patch })) to atomically merge the filtered snapshot keys into the current atom value. Existing keys not present in the snapshot are left untouched.
  • 'replace' — Atomic value swap. The adapter rebuilds the full state, preserving keys excluded by omitKeys, and writes it via store.set(atom, next).

Released under the MIT License.