Replies: 1 comment
-
Hello, so the thing is the interface MyWebsocketContext {
id: string;
created_at: number;
};
server.ws('/something', (ws) => {
const context = ws.context as MyWebsocketContext;
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I'm working now with websocket, learning about upgrade i did a code like this:
But when i start to work with ws.context i get this error
So i want to know: How can i do to
ws.context
have the type ofCoolTyping
? (I don't want to do(ws.context as CoolTyping).session.id
every timeOBS: The code runs without problems, i only want to know how to type the context
Beta Was this translation helpful? Give feedback.
All reactions