Properly unwrap StateEvent state before calling handler
This commit is contained in:
@@ -93,7 +93,9 @@ export class SocketRouteBuilder {
|
||||
*/
|
||||
async build(request: Request, ws: WebSocketBus): Promise<void> {
|
||||
await this.handlers.promiseMap(handler => {
|
||||
ws.subscribe(handler.eventClass, handler.handler.apply(request))
|
||||
ws.subscribe(handler.eventClass, (event: StateEvent<JSONState>) => {
|
||||
return handler.handler.apply(request)(event.getState())
|
||||
})
|
||||
})
|
||||
|
||||
if ( this.connectionCallback ) {
|
||||
|
||||
Reference in New Issue
Block a user