Skip to content

Commit 51ad4c5

Browse files
author
Péter Hauszknecht
committed
optimize invoking listeners
1 parent 34035b2 commit 51ad4c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/store.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export class Store<S> implements IStore<S> {
2424
} finally {
2525
this.isDispatching = false;
2626
}
27-
this.listeners.forEach(listener => listener());
27+
for (let i = 0; i<this.listeners.length; ++i)
28+
this.listeners[i]();
2829
return this.state;
2930
};
3031

0 commit comments

Comments
 (0)