We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All the function for an event emitter object has not yet be implemented. Especially, removeListener. See spec: https://nodejs.org/api/events.html#events_emitter_removelistener_eventname_listener
removeListener
it is included in once() because the listener is removed at first occurrence. But when register with on(), there is no way yet to remove the listener.
once()
on()
Consider one listener per event only. Removing the listener is equivalent to removing the event.
Consider several listeners per event. removeListener should be able to remove the correct listener.
callbacks
rm
digest::digest()
myEmitter <- EventEmitter$new() myEmitter$on('event', function() { message("an event occured") } )
how to remove this listener with anonymous function ?
myEmitter$removeListener('event", function() { message("an event occured") })
Only allow it with named function?
myEmitter <- EventEmitter$new() my_fun <- function() { message("an event occured") } myEmitter$on('event', my_fun)
myEmitter$removeListener('event', "myfun")
myEmitter$removeListener('event', myfun)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
All the function for an event emitter object has not yet be implemented. Especially,
removeListener
.See spec: https://nodejs.org/api/events.html#events_emitter_removelistener_eventname_listener
it is included in
once()
because the listener is removed at first occurrence. But when register withon()
, there is no way yet to remove the listener.Easy way :
Consider one listener per event only. Removing the listener is equivalent to removing the event.
Hard way:
Consider several listeners per event.
removeListener
should be able to remove the correct listener.Ideas:
callbacks
objects return arm
function at registration.digest::digest()
?examples
how to remove this listener with anonymous function ?
myEmitter$removeListener('event", function() { message("an event occured") })
?Only allow it with named function?
myEmitter$removeListener('event', "myfun")
?myEmitter$removeListener('event', myfun)
?The text was updated successfully, but these errors were encountered: