Type Alias: CommandExecutor
ts
type CommandExecutor = <R, D, T>(type: T, data?: D) => CommandDescriptor<R>;Defined in: src/wirestate-react/types/commands.ts:23
Represents the function returned by useCommandExecutor.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
R | unknown | The expected result type of the command task. |
D | unknown | The type of the data payload. |
T extends CommandType | CommandType | The command identifier type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
type | T | The command identifier. |
data? | D | Optional payload for the command. |
Returns
A descriptor containing the execution task and status.
Remarks
Typically returned by useCommandExecutor. Dispatched commands are automatically wrapped in a CommandDescriptor.