Skip to main content

Slice

@rotorsoft/act-root


@rotorsoft/act-root / act/src / Slice

Type Alias: Slice<TSchemaReg, TEvents, TActions, TStateMap, TActor, TLanes>

Slice<TSchemaReg, TEvents, TActions, TStateMap, TActor, TLanes> = object

Defined in: libs/act/src/builders/slice-builder.ts:38

A self-contained functional slice grouping partial states with their scoped reactions. Slices are composed into an Act orchestrator via act().withSlice(slice).

Type Parametersโ€‹

TSchemaRegโ€‹

TSchemaReg extends SchemaRegister<TActions>

Schema register for states

TEventsโ€‹

TEvents extends Schemas

Event schemas from this slice's states

TActionsโ€‹

TActions extends Schemas

Action schemas from this slice's states

TStateMapโ€‹

TStateMap extends Record<string, Schema> = { }

Map of state names to state schemas

TActorโ€‹

TActor extends Actor = Actor

Actor type extending base Actor

TLanesโ€‹

TLanes extends string = typeof DEFAULT_LANE

Propertiesโ€‹

_tagโ€‹

readonly _tag: "Slice"

Defined in: libs/act/src/builders/slice-builder.ts:47


eventsโ€‹

readonly events: EventRegister<TEvents>

Defined in: libs/act/src/builders/slice-builder.ts:49


lanesโ€‹

readonly lanes: ReadonlyArray<LaneConfig>

Defined in: libs/act/src/builders/slice-builder.ts:57

Drain lanes declared on this slice via .withLane(...) (ACT-1103). act().withSlice(slice) merges these into the Act's lane set so .to({lane}) is statically checked at the slice's call site against the lanes the slice itself declared.


projectionsโ€‹

readonly projections: ReadonlyArray<Projection<any>>

Defined in: libs/act/src/builders/slice-builder.ts:50


statesโ€‹

readonly states: Map<string, State<any, any, any>>

Defined in: libs/act/src/builders/slice-builder.ts:48