Skip to content

@statesync/mobx


@statesync/mobx / MobXApplyMode

Type Alias: MobXApplyMode

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

Defined in: mobx.ts:31

The strategy used to apply incoming snapshot data to the MobX store.

  • 'patch' — Iterates filtered keys and assigns them directly on the observable (store[key] = value). Existing keys not present in the snapshot are left untouched. MobX's reactivity tracks each property mutation.
  • 'replace' — First deletes allowed keys not present in the new state, then assigns keys from the new state. The observable reference remains the same, so existing autorun / reaction / observer consumers continue to work without re-wiring.

Released under the MIT License.