Skip to main content
Version: Current

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/types/builders.ts:974

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/types/builders.ts:982


events​

readonly events: EventRegister<TEvents>

Defined in: libs/act/src/types/builders.ts:984


lanes​

readonly lanes: ReadonlyArray<LaneConfig>

Defined in: libs/act/src/types/builders.ts:992

Drain lanes declared on this slice via .withLane(...). 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/types/builders.ts:985


states​

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

Defined in: libs/act/src/types/builders.ts:983