Closed futpib closed 2 years ago
Any suggestions on how we could solve this?
One idea is to add a special symbol to the returned promise and add a .offOnce()
method to Emittery that checks for the special symbol and unsubscribes.
Maybe extend the returned promise with an unsubscribe
or off
method?
Yeah, that may be more discoverable.
once
returns a promise and nothing else, so if you do aonce
and it never gets emitted it's leaked forever.