Skip to content

MarkController

Defined in: core/src/features/tokens/MarkController.ts:26

Id-backed mark command surface. The controller holds a stable token id (not a frozen {address, snapshot} capture and not an eager handle) plus the render-tree token it was built from, used ONLY as a read fallback.

Reads (value/meta/slot) prefer the LIVE handle: store.tokens.handle(id) is re-resolved on every access, so they track text-path commits (and the controller’s own updates after re-bind) without re-capture. That id lookup is latch-gated — it serves undefined while a structural apply awaits its bind (the routine pending window hit on EVERY render before the freshly-painted DOM binds). In that window a read falls back to the construction-time token, which the adapter just handed in fresh for this very render: the rendered mark shows its value immediately instead of flashing empty until a re-render that the adapter never schedules.

Writes (update/remove) stay strictly latch-gated: they resolve the LIVE handle only and never act on the captured token (whose position can be a generation stale). Against a pending (mid-window) or dead handle, or in read-only mode, they are a fail-closed no-op returning false.

new MarkController(
store,
id,
captured): MarkController;

Defined in: core/src/features/tokens/MarkController.ts:27

Parameter Type
store Store
id number
captured MarkToken

MarkController

get meta(): string | undefined;

Defined in: core/src/features/tokens/MarkController.ts:61

string | undefined


get readOnly(): boolean;

Defined in: core/src/features/tokens/MarkController.ts:69

boolean


get slot(): string | undefined;

Defined in: core/src/features/tokens/MarkController.ts:65

string | undefined


get value(): string;

Defined in: core/src/features/tokens/MarkController.ts:57

string

remove(): boolean;

Defined in: core/src/features/tokens/MarkController.ts:73

boolean


update(patch): boolean;

Defined in: core/src/features/tokens/MarkController.ts:80

Parameter Type
patch MarkPatch

boolean


static fromToken(store, token): MarkController;

Defined in: core/src/features/tokens/MarkController.ts:33

Parameter Type
store Store
token MarkToken

MarkController