EventStapler
Event Stapler is a utility to attach a collection of event listeners to an emitter in such a way that it is very easy to unbind them all later. All events attached via a staple can be detached in a single call, or after a specific event is fired by the emitter.
Example
const eventStapler = ;const stream = ; const stapled = ; { // process data console;} { // handler is called with additional parameters provided at point of binding console; stapled; // manually remove staple. all event handlers released.} { console;} { // handle error. // don't worry about cleaning up old event listeners console;}