json-dom
    Preparing search index...

    Function removeEventListener

    • Find and remove an event listener from a DomItem: detaches it from the element first (via deactivateListener) if it was active, then splices its descriptor out of eventListeners. A no-op if no matching listener is found.

      item is the last parameter (instead of customArgs/options having literal defaults) so this can be curried and piped directly - see fullAddEventListener for an example of the pattern.

      Parameters

      • eventName: string

        The name of the trigger event the listener was registered under.

      • listenerFunction: string | ListenerFunction

        The listener function to match against.

      • customArgs: object | null | undefined

        The custom args the listener was registered with.

      • options: ListenerOptions | null | undefined

        The options the listener was registered with.

      • item: DomItem

        The DomItem to remove the listener from.

      Returns DomItem

      The same DomItem, with the matching listener removed if one was found.