Eventilator: but can your event manager do this?
API:
.on/once['any-event-name'] | .on/once(target, event, handle, options)
- add listener.on/once(target, { event: handle })
- add listeners.off(target, event, handle) | handle.off
- remove listener.emit(target, type, detail) | handle.emit(type, detail)
- emit event.curry
- extra (used internally but why not share)
const on once = eventilator let count = 0 const handle = on console handle handle // same as handle == handle.off console handle handle console handle
const on once = eventilator const handles = const click: off: clickOff keydown: off: keydownOff } = handles try await catch e handlesclick
Arrays or Selectors finding multiple elements works as well.
const aHndl bHndl cHndl = on aHndlbHndlcHndl // orconst handlers = onhandlers // <- loops over each and turns'em off