Skip to main content

Slice

@rotorsoft/act-root


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

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

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

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

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

Properties

_tag

readonly _tag: "Slice"

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


events

readonly events: EventRegister<TEvents>

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


projections

readonly projections: ReadonlyArray<Projection<any>>

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


states

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

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