mobx 6.15.1 → 6.15.3

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.15.1",
3
+ "version": "6.15.3",
4
4
  "description": "Simple, scalable state management.",
5
5
  "source": "src/mobx.ts",
6
6
  "main": "dist/index.js",
@@ -64,7 +64,7 @@
64
64
  "test": "jest --config jest.projects.js",
65
65
  "lint": "eslint src/**/*",
66
66
  "build": "node ../../scripts/build.js mobx",
67
- "build:test": "npm run build --target test",
67
+ "build:test": "npm run build -- --target test",
68
68
  "perf": "scripts/perf.sh",
69
69
  "perf-legacy": "node --expose-gc ./__tests__/perf/index.js legacy",
70
70
  "perf-proxy": "node --expose-gc ./__tests__/perf/index.js proxy",
@@ -75,6 +75,6 @@
75
75
  "test:coverage": "yarn test -i --coverage",
76
76
  "test:size": "yarn import-size --report . observable computed autorun action",
77
77
  "test:check": "yarn test:types",
78
- "prepublishOnly": "node ./scripts/prepublish.js && npm run build --target publish"
78
+ "prepublishOnly": "node ./scripts/prepublish.js && npm run build -- --target publish"
79
79
  }
80
80
  }
package/src/api/flow.ts CHANGED
@@ -35,7 +35,14 @@ export function isFlowCancellationError(error: Error) {
35
35
 
36
36
  export type CancellablePromise<T> = Promise<T> & { cancel(): void }
37
37
 
38
- interface Flow extends Annotation, PropertyDecorator, ClassMethodDecorator {
38
+ type FlowGenerator = (...args: any[]) => Generator<any, any, any> | AsyncGenerator<any, any, any>
39
+
40
+ // PropertyDecorator is only for legacy decorators
41
+ interface Flow extends Annotation, PropertyDecorator {
42
+ <This, Value extends FlowGenerator>(
43
+ value: Value,
44
+ context: ClassMethodDecoratorContext<This, Value>
45
+ ): Value | void
39
46
  <R, Args extends any[]>(
40
47
  generator: (...args: Args) => Generator<any, R, any> | AsyncGenerator<any, R, any>
41
48
  ): (...args: Args) => CancellablePromise<R>