@cfware/add-event-listener
Calls owner.addEventListener and returns a function to remove the listener.
Usage
import addEventListener from '@cfware/add-event-listener';
class MyElement extends HTMLElement {
connectedCallback() {
this._cleanupFn = addEventListener(window, 'click', () => console.log('click'));
}
disconnectedCallback() {
this._cleanupFn();
}
}