v5.0.0
Breaking changes
Migration
Listener removal
v3 (old)
const delegation = delegate(document, 'a', 'click', console.log);
delegation.destroy();
v4 (old)
const controller = delegate(document, 'a', 'click', console.log);
controller.abort();
v5 (new)
This was already possible in v4, so if you were using this pattern, you don't need to change anything.
const controller = new AbortController();
delegate(document, 'a', 'click', console.log, {signal: controller.signal});
controller.abort();