Skip to content

Thread of execution depends on event's listeners. #25

Description

@Elergy

If we have a few of subscribers and one of those throws an exception, our thread of execution well be interrupted.

For example:

var hub = new Mediator();
hub.on('test', function func1() { console.log(1); });
hub.on('test', function func2() { throw new Error('test error'); });
hub.on('test', function func3() { console.log(3); });

hub.trigger('test');
console.log(4);

Actual result:

1
throwing exception

Expected result:

1
3
4
and throwing exception with stacktrace

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions