Skip to content
Roomful is in public beta — install with the @beta tag. Share feedback →

Interface: StateEngine\<T\>

@roomful/core


@roomful/core / StateEngine

Defined in: packages/core/src/types.ts:1089

Exposes shared-state operations for a room.

T

The shared state value type.

get(): T

Defined in: packages/core/src/types.ts:1095

Reads the latest shared state value.

T

The current shared state value.


patch(partial): void

Defined in: packages/core/src/types.ts:1111

Partially updates a shared object state.

Partial<T>

The partial state value to merge.

void

Nothing.


reset(): void

Defined in: packages/core/src/types.ts:1133

Restores the shared state to its initial value.

void

Nothing.


set(value): void

Defined in: packages/core/src/types.ts:1103

Replaces the shared state value.

T

The next shared state value.

void

Nothing.


subscribe(cb): Unsubscribe

Defined in: packages/core/src/types.ts:1119

Subscribes to shared-state changes.

(value, meta) => void

The callback invoked with the latest value and metadata.

Unsubscribe

A function that removes the listener.


undo(): void

Defined in: packages/core/src/types.ts:1126

Reverts the most recent shared-state change when possible.

void

Nothing.