API reference / @chanx-js/server / core / On
Function: On()
ts
function On<D, O>(message, options?): MethodDecorator<HandlerMethod<D, O>>;Defined in: packages/server/src/classes.ts:138
Handle a client message. Return a declared output to reply.
Type Parameters
| Type Parameter | Default type |
|---|---|
D extends AnyMessageDefinition | - |
O extends Outputs | never |
Parameters
| Parameter | Type |
|---|---|
message | D |
options | HandlerOptions<O> |
Returns
MethodDecorator<HandlerMethod<D, O>>