mobx 6.15.2 → 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.2",
3
+ "version": "6.15.3",
4
4
  "description": "Simple, scalable state management.",
5
5
  "source": "src/mobx.ts",
6
6
  "main": "dist/index.js",
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>