Skip to content

Commit

Permalink
Stop mutating handler[type] in EventBus
Browse files Browse the repository at this point in the history
If you remove the handler currently being executed, the next
handler in the list will not be run.
  • Loading branch information
justinanastos committed Feb 2, 2017
1 parent 9de5764 commit 9876e0d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/EventBus.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function EventBus() {
if (!type || !listener || !handlers[type]) return;
const idx = getHandlerIdx(type, listener, scope);
if (idx < 0) return;
handlers[type] = handlers[type].slice(0);
handlers[type].splice(idx, 1);
}

Expand Down

0 comments on commit 9876e0d

Please sign in to comment.