Type Alias CommandHandler<TData, TOptions>

CommandHandler<TData, TOptions>: ((state: Readonly<State<TData, TOptions>>) => MaybePromise<unknown>)

A command handler function that receives the current state and performs some action.

Type Parameters

  • TData = unknown

    Optional type for data specific to this command.

  • TOptions extends OptionsConfig = OptionsConfig

    The OptionsConfig type for the command.

Type declaration

    • (state): MaybePromise<unknown>
    • Parameters

      Returns MaybePromise<unknown>