Skip to content

Intermact API Reference / @intermact/core / RuntimeStateStore

Class: RuntimeStateStore

Defined in: packages/core/src/runtime/store.ts:19

Immutable runtime-state store keyed by object id. Each applyPatch produces a new state value for the target while leaving others referentially stable, so renderers can diff cheaply by identity (design.md §4.3, §15.2).

The store holds the RuntimeState union (2D | 3D) and dispatches the correct patch application by the stored state's dimension discriminator.

Constructors

Constructor

new RuntimeStateStore(): RuntimeStateStore

Returns

RuntimeStateStore

Methods

applyPatch()

applyPatch(patch): void

Defined in: packages/core/src/runtime/store.ts:33

Merge a patch into the target's state (no-op for unknown targets).

Parameters

patch

StatePatch

Returns

void


clone()

clone(): RuntimeStateStore

Defined in: packages/core/src/runtime/store.ts:60

Deep-ish clone for deterministic per-seek evaluation from a baseline.

Returns

RuntimeStateStore


entries()

entries(): ReadonlyMap<string, RuntimeState>

Defined in: packages/core/src/runtime/store.ts:55

Snapshot of all states as a readonly map.

Returns

ReadonlyMap<string, RuntimeState>


get()

get(id): RuntimeState | undefined

Defined in: packages/core/src/runtime/store.ts:28

Read current state for an object, if registered.

Parameters

id

string

Returns

RuntimeState | undefined


resetTo()

resetTo(baseline): void

Defined in: packages/core/src/runtime/store.ts:67

Reset to a baseline set of states (replaces all entries).

Parameters

baseline

ReadonlyMap<string, RuntimeState>

Returns

void


set()

set(id, state): void

Defined in: packages/core/src/runtime/store.ts:23

Seed an object's baseline state.

Parameters

id

string

state

RuntimeState

Returns

void

Intermact v1.0 — 文档覆盖 Phase-1 / Phase-2 / Phase-3(全阶段)