ICommandHandler

Represents a command handler. Command handlers are used to execute commands.


type ICommandHandler<TCommand extends ICommand = any, TResult = any> = TCommand extends Command<infer InferredCommandResult> ? {
    execute(command: TCommand): Promise<InferredCommandResult>;
} : {
    execute(command: TCommand): Promise<TResult>;
};