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
BTW What is the reason of having socket.event = [ 'data', 'present' ]? This is done by EventEmitter2. What socket want to do with event? This is the awful workaround.
It would probably be helpful to add some information to the readme about this.event in the EE callback, but nssocket is not particularly concerned with what you do with the data after it gets fired. The reason that exists in the EventEmitter2 scope is specifically for wildcards.
On your second comment, I have no idea what you mean. Could you provide clarity of what is a workaround?
@nucleardreamer, See here. I am sure that some programmer passed this.event as temporaly workaround but community decided this to be a "pattern". This is funny. Please do not use this part of "pattern".
socket.event means the last event name on the socket. Any setImmediate (for example Promise) will make socket.event meaningless for current event handler.
socket.data(['iam', 'here'], function (data) {});
You want to provide data as 1-st argument. Why second argument couldn't be a event?
But what about generic event names? It is not possible to predict
event
. We've found a way in examples:There is no information about
this.event
in docs. This is very important, please fix.The text was updated successfully, but these errors were encountered: