Skip to content

eventApi

eventApi<M, K>(machine: M, filterStateKey?: K): FactoryMachineApi<M>

Defined in: factory-machine-event-api.ts:13

Creates an API object for a FactoryMachine instance, providing event sender functions for each transition.

Type ParameterDefault typeDescription
M extends FactoryMachine<any>-Type of FactoryMachine
K extends string | number | symbolkeyof M["transitions"]Keys of machine transitions
ParameterTypeDescription
machineMThe machine instance to generate the API for
filterStateKey?KOptional state key to filter transitions

FactoryMachineApi<M>

An object mapping event keys to sender functions