Closed grahhnt closed 8 months ago
@grahhnt can you please explain the goal of this request? What problem are you encountering?
@gregra81 i guess this is more of personal preference as this is the first library I've used that gave the "undo" action as a returned function
This was also sparked due to the type definitions not matching actual implementation (see the related PR)
@grahhnt Got it. This is indeed a preference that was chosen years ago when it was implemented. BTW, as a side note, react's useEffect
is also taking this approach, its return function is intended for clean up.
About the types PR - we'll take this and review. In the meantime I'm closing this one
Related #137
Instead of returning a function to unsubscribe/unlisten from #listen, supply a method to unlisten based on event name or function reference
See also socket.io's event management but not just limited to socket.io