Skip to content

Commit

Permalink
optimize invoking listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
Péter Hauszknecht committed Sep 4, 2017
1 parent 34035b2 commit 51ad4c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export class Store<S> implements IStore<S> {
} finally {
this.isDispatching = false;
}
this.listeners.forEach(listener => listener());
for (let i = 0; i<this.listeners.length; ++i)
this.listeners[i]();
return this.state;
};

Expand Down

0 comments on commit 51ad4c5

Please sign in to comment.