Skip to content

Commit

Permalink
fix(dispatch): compute listeners length at each loop iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabien Motte committed Feb 8, 2017
1 parent 38cfb04 commit 37cb9df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class Signal {
throw new Error('Signal.dispatch() : Maximum dispatch limit reached (prevent infinite loop)')
}

for (let i = 0, listenersLength = this._listeners.length; i < listenersLength; i++) {
for (let i = 0; i < this._listeners.length; i++) {
const listener = this._listeners[i]

if (listener.once) {
Expand Down

0 comments on commit 37cb9df

Please sign in to comment.