Register a DOM event listener. Returns a function that unregisters this specific listener early if needed (most callers ignore it and rely on group-level dispose()).
Register a DOM event listener. Returns a function that unregisters this specific listener early if needed (most callers ignore it and rely on group-level dispose()).
Register a DOM event listener. Returns a function that unregisters this specific listener early if needed (most callers ignore it and rely on group-level dispose()).
Register a DOM event listener. Returns a function that unregisters this specific listener early if needed (most callers ignore it and rely on group-level dispose()).
Optionaloptions: boolean | AddEventListenerOptionsRegister an arbitrary cleanup callback (e.g. observer.disconnect(),
cancelAnimationFrame(handle), vendor-library unsubscribe()). Runs in
LIFO order with the listeners on dispose().
Run every registered cleanup in reverse order and clear the group. Idempotent: a second dispose() does nothing.
Number of registered cleanups still pending. Useful for tests.