onCommand
onCommand<
TSchema>(contract,handler,options?):CommandHandlerDeclaration
Defined in: packages/hoppity/src/handlers/onCommand.ts:15
Declares a typed command handler for use in the service config handlers array.
Same type-inference behavior as onEvent — the contract’s schema drives the handler’s content type.
Type Parameters
Section titled “Type Parameters”TSchema
Section titled “TSchema”TSchema extends ZodTypeAny
Parameters
Section titled “Parameters”contract
Section titled “contract”CommandContract<any, any, TSchema>
The CommandContract to handle
handler
Section titled “handler”CommandHandler<TSchema>
The handler function
options?
Section titled “options?”Optional queue/redelivery/dead-letter overrides