mobx 6.4.1 → 6.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobx",
3
- "version": "6.4.1",
3
+ "version": "6.4.2",
4
4
  "description": "Simple, scalable state management.",
5
5
  "source": "src/mobx.ts",
6
6
  "main": "dist/index.js",
@@ -203,7 +203,11 @@ function warnAboutDerivationWithoutDependencies(derivation: IDerivation) {
203
203
  return
204
204
  }
205
205
 
206
- if (globalState.reactionRequiresObservable || derivation.requiresObservable_) {
206
+ if (
207
+ typeof derivation.requiresObservable_ === "boolean"
208
+ ? derivation.requiresObservable_
209
+ : globalState.reactionRequiresObservable
210
+ ) {
207
211
  console.warn(
208
212
  `[mobx] Derivation '${derivation.name_}' is created/updated without reading any observable value.`
209
213
  )
@@ -67,7 +67,7 @@ export class Reaction implements IDerivation, IReactionPublic {
67
67
  public name_: string = __DEV__ ? "Reaction@" + getNextId() : "Reaction",
68
68
  private onInvalidate_: () => void,
69
69
  private errorHandler_?: (error: any, derivation: IDerivation) => void,
70
- public requiresObservable_ = false
70
+ public requiresObservable_?
71
71
  ) {}
72
72
 
73
73
  onBecomeStale_() {
@@ -169,7 +169,7 @@ export class Reaction implements IDerivation, IReactionPublic {
169
169
  if (!globalState.suppressReactionErrors) {
170
170
  console.error(message, error)
171
171
  /** If debugging brought you here, please, read the above message :-). Tnx! */
172
- } else if (__DEV__) {console.warn(`[mobx] (error in reaction '${this.name_}' suppressed, fix error of causing action below)`)} // prettier-ignore
172
+ } else if (__DEV__) { console.warn(`[mobx] (error in reaction '${this.name_}' suppressed, fix error of causing action below)`) } // prettier-ignore
173
173
 
174
174
  if (__DEV__ && isSpyEnabled()) {
175
175
  spyReport({