registerEventListeners
functionAdd several event listeners to a single `target` and return one function that removes all of them. This is the batch form of registerEventListener: it takes a `{type: listener}` object (strongly typed per event type) and shares one `options` value across every listener. The returned dispose function removes the listeners in reverse registration order (via mergeRegister). Because `options` is shared, register listeners that need a different `options` value (e.g. a different `capture` flag) with a separate call and combine the results with `mergeRegister`.
Import
import { registerEventListeners } from '@modular/sdk/editor';Notes
- example
- ```ts // All five listeners share {capture: true} return registerEventListeners( window, { beforeinput: report, cut: report, keydown: report, paste: report, selectionchange: report, }, {capture: true}, ); ```
- returns
- A function that removes every listener when called