Type alias CommandHandler<S, C, E, K>
CommandHandler<S, C, E, K>: ((data,
state,
actor?) => Promise<Message<E>[]>)
Type declaration
-
- (data, state, actor?): Promise<Message<E>[]>
-
Parameters
-
data: Readonly<C[K]>
-
state: Readonly<S>
-
Optional
actor: Actor
Returns Promise<Message<E>[]>
Command handlers handle commands and emit events
data
the command's payloadstate
the state of the artifact handling this command - Empty for systemsactor?
the actor invoking the command