You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked that this question would not be more appropriate as an issue in a specific repository
I have searched existing discussions and documentation for answers
Question Category
Protocol Specification
SDK Usage
Server Implementation
General Implementation
Documentation
Other
Your Question
Why is Transport's onclose / onerror / onmessage a property? It can only be listened by one function.
// ... /** * Callback for when the connection is closed for any reason. * * This should be invoked when close() is called as well. */
onclose?: ()=>void;/** * Callback for when an error occurs. * * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band. */
onerror?: (error: Error)=>void;/** * Callback for when a message (request or response) is received over the connection. */
onmessage?: (message: JSONRPCMessage)=>void;// ...
I do not understand this decision. I am implementing a custom Transport on server, and I need to listen to the close event too.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Question Category
Your Question
Why is Transport's
onclose
/onerror
/onmessage
a property? It can only be listened by one function.I do not understand this decision. I am implementing a custom Transport on server, and I need to listen to the
close
event too.Beta Was this translation helpful? Give feedback.
All reactions