Skip to content

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 ParameterDefault type
D extends AnyMessageDefinition-
O extends Outputsnever

Parameters ​

ParameterType
messageD
optionsHandlerOptions<O>

Returns ​

MethodDecorator<HandlerMethod<D, O>>

MIT licensed