Skip to content

Commit

Permalink
fix: support strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
chnliquan committed Jan 15, 2021
1 parent 499146f commit 9a82fda
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/Model.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useState, useRef, useEffect, Dispatch } from 'react'
import { unstable_batchedUpdates as batchedUpdates} from 'react-dom'
import produce from 'immer'
import {
ConfigReducer,
Expand Down Expand Up @@ -170,7 +171,7 @@ export class Model<C extends ModelConfig> {
this.devtoolInstance.send(`${this.options.name}/${name}`, state)
}

this.container.notify(state)
batchedUpdates(this.container.notify.bind(this.container, state))
}

private getReducers(config: C): ContextPropsModel<C>['reducers'] {
Expand Down

0 comments on commit 9a82fda

Please sign in to comment.