interface: wraps zustand setter in batchUpdate
@@ -20,6 +20,7 @@ import GcpReducer from '../reducers/gcp-reducer';
import { OrderedMap } from '../lib/OrderedMap';
import { BigIntOrderedMap } from '../lib/BigIntOrderedMap';
import { GroupViewReducer } from '../reducers/group-view';
+import { unstable_batchedUpdates } from 'react-dom';
export default class GlobalStore extends BaseStore<StoreState> {
inviteReducer = new InviteReducer();
@@ -50,6 +51,7 @@ export default class GlobalStore extends BaseStore<StoreState> {
}
reduce(data: Cage, state: StoreState) {
+ unstable_batchedUpdates(() => {
// debug shim
const tag = Object.keys(data)[0];
const oldActions = this.pastActions[tag] || [];
@@ -66,5 +68,6 @@ export default class GlobalStore extends BaseStore<StoreState> {
ContactReducer(data);
this.settingsReducer.reduce(data);
this.gcpReducer.reduce(data);
+ });
}
}
