Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Commit

Permalink
resolves #129
Browse files Browse the repository at this point in the history
  • Loading branch information
quisido committed Sep 16, 2019
1 parent 847ee25 commit 19407e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reactn",
"version": "2.2.2",
"version": "2.2.3",
"author": "Charles Stover <reactn@charlesstover.com>",
"description": "React, but with built-in global state management.",
"homepage": "https://github.com/CharlesStover/reactn#readme",
Expand Down
9 changes: 6 additions & 3 deletions src/global-state-manager.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { unstable_batchedUpdates } from 'react-dom';
import { Reducers, State } from '../default';
import Callback from '../types/callback';
import DispatchFunction from '../types/dispatch-function';
Expand Down Expand Up @@ -193,9 +194,11 @@ export default class GlobalStateManager<
this.clearQueue();

// Force update all components that were a part of the queue.
for (const propertyListener of propertyListeners) {
propertyListener();
}
unstable_batchedUpdates((): void => {
for (const propertyListener of propertyListeners) {
propertyListener();
}
});

// Call each global callback.
for (const callback of this._callbacks) {
Expand Down

0 comments on commit 19407e6

Please sign in to comment.