Similar to matchListener function but has methods for attaching and removing itself from multiple elements at the same time.

This gives the listener a 'personality' and promotes its reuse (good practice).

Example

import { MatchListener } from 'deleight/eutility';
const listener = new MatchListener({
'a.lbl': e => select(e.target.parentNode.parentNode),
'span.remove': [removeListener, preventDefault, stopPropagation]
}, true);

listener.listen('click', [window.table1, window.table2], eventOptions)

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

listener: EventListenerOrEventListenerObject

Methods

  • Parameters

    • eventName: string
    • elements: EventTarget[]
    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Parameters

    • eventName: string
    • Rest ...elements: EventTarget[]

    Returns void