javascript - removeListener in the Listener in nodejs -
in addition this question. possible remove listener inside callback function?
for example:
var callback = function(stream) { if(something) dosomething(); else server.removelistener('connection', callback); }; server.on('connection', callback);
yes possible. node's eventemitter
class provide once
function, in order attach listener called... once.
Comments
Post a Comment