OnOpen
OnOpen():
MethodDecorator
Defined in: src/decorators/websocket.ts:91
Decorator for WebSocket open handler. Return value is automatically set to ws.data and ctx.state.
Returns
Section titled “Returns”MethodDecorator
Example
Section titled “Example”@OnOpen()handleOpen(ctx: ShokupanContext, ws: WebSocket) { return { userId: getUserId(ctx) };}