Type alias CommandHandler<S, C, E, K>

CommandHandler<S, C, E, K>: ((data, state, actor?) => Promise<Message<E>[]>)

Type Parameters

Type declaration

    • (data, state, actor?): Promise<Message<E>[]>
    • Command handlers handle commands and emit events

      • data the command's payload
      • state the state of the artifact handling this command - Empty for systems
      • actor? the actor invoking the command

      Parameters

      • data: Readonly<C[K]>
      • state: Readonly<S>
      • Optional actor: Actor

      Returns Promise<Message<E>[]>

Generated using TypeDoc