v4.0.0
Breaking changes
- Only accept iterables, not any array-likes ec3232d by @fregante
- Output modern code 6ac66e2 by @fregante
- Return
AbortController
instead of{destroy()}
+ supportsignal
(#28) 4f3d7ea by @cheap-glitch
Migration
Listener removal
Before:
const delegation = delegate(document, 'a', 'click', console.log);
delegation.destroy();
After:
const controller = delegate(document, 'a', 'click', console.log);
controller.abort();
// or provide your own signal
const controller = new AbortController();
delegate(document, 'a', 'click', console.log, {signal: controller.signal});
controller.abort();
Types
Before:
import delegate from 'delegate-it'
function listener(event: delegate.Event) {}
After:
import delegate, {DelegateEvent} from 'delegate-it'
function listener(event: DelegateEvent) {}