Skip to main content

Type Alias: ContinuousUpdate<TState>

type ContinuousUpdate<TState> = {
initial_state?: TState;
sample: ComponentsManifest | EntityDirective | null;
};

Defined in: livelink.clients/livelink.agent/sources/data/EventMapping.ts:96

An update that keeps producing values after the event that installed it. Build one with continuous.

Some events carry a rate, not a value — "the shaft is turning at 90 rpm". A rate still means something once the message that delivered it is gone, so a mapping that returned a finished patch would leave the entity frozen until the next message. Returning one of these instead says what the entity is doing, and the pipeline re-samples it on its own clock until a later event for the same id replaces it.

Type Parameters

Type ParameterDefault type
TState extends objectRecord<string, never>

Properties

initial_state?

readonly optional initial_state?: TState;

Defined in: livelink.clients/livelink.agent/sources/data/EventMapping.ts:112

The state to start from. Used only the first time this entity is given a state, so a later event does not reset a motion already under way.

Methods

sample()

sample(context: ContinuousUpdateContext<TState>):
| ComponentsManifest
| EntityDirective
| null;

Defined in: livelink.clients/livelink.agent/sources/data/EventMapping.ts:106

Where the entity is now. Returns component patches, a whole-entity EntityDirective (so a motion can end by hiding or deleting what it was driving — both also uninstall it), or null when the motion is over — the continuation is then forgotten and the entity keeps its last value.

Parameters

ParameterType
contextContinuousUpdateContext<TState>

Returns

| ComponentsManifest | EntityDirective | null