Properly unwrap StateEvent state before calling handler
This commit is contained in:
parent
b8cf8499d2
commit
8a153e3807
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@extollo/lib",
|
"name": "@extollo/lib",
|
||||||
"version": "0.13.4",
|
"version": "0.13.5",
|
||||||
"description": "The framework library that lifts up your code.",
|
"description": "The framework library that lifts up your code.",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
|
@ -93,7 +93,9 @@ export class SocketRouteBuilder {
|
|||||||
*/
|
*/
|
||||||
async build(request: Request, ws: WebSocketBus): Promise<void> {
|
async build(request: Request, ws: WebSocketBus): Promise<void> {
|
||||||
await this.handlers.promiseMap(handler => {
|
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 ) {
|
if ( this.connectionCallback ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user