Maintains a list of listeners to receive data
const d = new DispatchList();// Eg: add a listenerd.add(v => { // Handle a value});// Eg. send a value to all listenersd.notify(`some value`); Copy
const d = new DispatchList();// Eg: add a listenerd.add(v => { // Handle a value});// Eg. send a value to all listenersd.notify(`some value`);
Adds a handler. You get back an id which can be used to remove the handler later.
Handlers can be added with 'once' flag set to true. This will automatically remove them after the first value is sent to them.
Remove all handlers
Returns true if list is empty
Emit a value to all handlers
Remove a handler by its id.
True if handler was removed, false if not found.
Maintains a list of listeners to receive data