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 Parameters
Section titled “Type Parameters”Type Parameter | Default type | Description |
---|---|---|
M extends FactoryMachine <any > | - | Type of FactoryMachine |
K extends string | number | symbol | keyof M ["transitions" ] | Keys of machine transitions |
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
machine | M | The machine instance to generate the API for |
filterStateKey? | K | Optional state key to filter transitions |
Returns
Section titled “Returns”FactoryMachineApi
<M
>
An object mapping event keys to sender functions