Skip to content

Commit ea9a92b

Browse files
committed
fix: not throwing errors when multiple updates happen
1 parent 50fd5d7 commit ea9a92b

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/state.js

-6
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,16 @@ class State extends Component {
1818
: props.select(this.broadcast.getState())
1919
this.update = this.update.bind(this)
2020
this.setStateIfNeeded = this.setStateIfNeeded.bind(this)
21-
this.isUpdating = false
2221
}
2322

2423
update (updaterFn) {
2524
if (this.props.state) {
2625
this.setState(updaterFn)
2726
} else {
28-
if (this.isUpdating) {
29-
throw new Error('Updaters may not invoke update function.')
30-
}
31-
this.isUpdating = true
3227
const oldState = this.broadcast.getState()
3328
const nextState = updaterFn(oldState)
3429
this.inspect && this.inspect(oldState, nextState, updaterFn)
3530
this.broadcast.setState(nextState)
36-
this.isUpdating = false
3731
}
3832
}
3933

0 commit comments

Comments
 (0)