Overload #1
execute<R = void>(command: Command<R>): Promise<R>
Parameters
| Option |
Type |
Description |
command
|
Command |
The command to execute.
|
Returns
Promise<R> A promise that, when resolved, will contain the result returned by the command's handler.
Overload #2
execute<R = void>(command: Command<R>, context?: AsyncContext): Promise<R>
Parameters
| Option |
Type |
Description |
command
|
Command |
The command to execute.
|
context
|
AsyncContext |
The context to use. Optional.
Optional. Default is `undefined`.
|
Returns
Promise<R> A promise that, when resolved, will contain the result returned by the command's handler.
Overload #3
execute<T extends CommandBase, R = any>(command: T, context?: AsyncContext): Promise<R>
Parameters
| Option |
Type |
Description |
command
|
T |
The command to execute.
|
context
|
AsyncContext |
The context to use. Optional.
Optional. Default is `undefined`.
|
Returns
Promise<R> A promise that, when resolved, will contain the result returned by the command's handler.