Skip to content

Implementation of stopImmediatePropagation #93

Open

Description

@boblund

I implemented stopImmediatePropagation with a really simple change. In the emit prototype loop that executes the listeners I check the ReflectApply return for the string 'stopImmediatePropagation'. To stop a event propagation the event handler then returns 'stopImmediatePropagation'.

Will this break something? Is there interest in adding this?

Activity

  1. boblund commented on Nov 4, 2024

    @boblund
    Author

    Here's the code change

        for (var i = 0; i < len; ++i)
          if( ReflectApply(listeners[i], this, args) === 'stopImmediatePropagation' ) break;
    
  2. goto-bus-stop commented on Nov 12, 2024

    @goto-bus-stop
    Member

    stopImmediatePropagation is part of the EventTarget API which is not supported by this module at the moment. Custom extensions outside of the Node.js API are out of scope. If we add this it should be part of the EventTarget API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions