In #13 we replaced options.delay of MobX reaction with our own debounce realization, which caused that the effect will be run outside the effect handler of MobX reaction. So we need to wrap the effect with runInAction, or we got error in projects with strict-mode enabled:
mobx.module.js?daf9:92 Uncaught Error: [mobx] Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: FieldState@183._validateStatus
at invariant (mobx.module.js?daf9:92)
at fail (mobx.module.js?daf9:87)
at checkIfStateModificationsAreAllowed (mobx.module.js?daf9:746)
at ObservableValue.prepareNewValue (mobx.module.js?daf9:1057)
at ObservableObjectAdministration.write (mobx.module.js?daf9:4045)
at FieldState.set [as _validateStatus] (mobx.module.js?daf9:4209)
In addition, we enabled strict-mode before our test cases, so that we can find such error when running unit test next time.
In #13 we replaced
options.delay
of MobXreaction
with our own debounce realization, which caused that the effect will be run outside the effect handler of MobXreaction
. So we need to wrap the effect withrunInAction
, or we got error in projects with strict-mode enabled:In addition, we enabled strict-mode before our test cases, so that we can find such error when running unit test next time.