Skip to content

v4.0.0

Compare
Choose a tag to compare
@fregante fregante released this 23 Jun 16:24
· 25 commits to main since this release

Breaking changes

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) {}

v3.0.1...v4.0.0