mobx 6.3.5 → 6.3.6

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.3.5",
3
+ "version": "6.3.6",
4
4
  "description": "Simple, scalable state management.",
5
5
  "source": "src/mobx.ts",
6
6
  "main": "dist/index.js",
@@ -12,7 +12,8 @@ import {
12
12
  die,
13
13
  ownKeys,
14
14
  extendObservable,
15
- addHiddenProp
15
+ addHiddenProp,
16
+ storedAnnotationsSymbol
16
17
  } from "../internal"
17
18
 
18
19
  // Hack based on https://github.com/Microsoft/TypeScript/issues/14829#issuecomment-322267089
@@ -30,6 +31,11 @@ export function makeObservable<T extends object, AdditionalKeys extends Property
30
31
  const adm: ObservableObjectAdministration = asObservableObject(target, options)[$mobx]
31
32
  startBatch()
32
33
  try {
34
+ if (__DEV__ && annotations && target[storedAnnotationsSymbol]) {
35
+ die(
36
+ `makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.`
37
+ )
38
+ }
33
39
  // Default to decorators
34
40
  annotations ??= collectStoredAnnotations(target)
35
41
 
package/src/api/when.ts CHANGED
@@ -72,7 +72,7 @@ function whenPromise(
72
72
  let disposer = _when(predicate, resolve, { ...opts, onError: reject })
73
73
  cancel = () => {
74
74
  disposer()
75
- reject("WHEN_CANCELLED")
75
+ reject(new Error("WHEN_CANCELLED"))
76
76
  }
77
77
  })
78
78
  ;(res as any).cancel = cancel