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
so if I use socket.on it will help me with ListenersEvents types, but when using socket.off it will not.
To Reproduce
the above code.
Expected behavior
the function socket.off be better in types.
Platform:
Device: Lenovo
OS: Ubuntu
Additional context
I looked at the typed-events.d.ts file and it looks like StrictEventEmitter extends from the Emitter interface without passing the names of the events, but on the other hand, the StrictEventEmitter class has implements the same functions that exist in the Emitter interface (why?!) so implement the off function and that's it!.
I think this is enough to explain the bug and the solution.
The text was updated successfully, but these errors were encountered:
Describe the bug
when I start using
socket.io-client
with typescript, I initilized my socket with the following code:so if I use
socket.on
it will help me withListenersEvents
types, but when usingsocket.off
it will not.To Reproduce
the above code.
Expected behavior
the function
socket.off
be better in types.Platform:
Additional context
I looked at the
typed-events.d.ts
file and it looks likeStrictEventEmitter
extends from theEmitter
interface without passing the names of the events, but on the other hand, theStrictEventEmitter
class has implements the same functions that exist in theEmitter
interface (why?!) so implement theoff
function and that's it!.I think this is enough to explain the bug and the solution.
The text was updated successfully, but these errors were encountered: