@omnia/fx-models 7.8.64-preview → 7.8.65-preview

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.
@@ -15,6 +15,12 @@ export declare class Future<T> extends Promise<T> {
15
15
  * @memberof Future
16
16
  */
17
17
  tryCatch(): Future<[success: T, error: Error]>;
18
+ /**
19
+ * Expose abort for other future to use.
20
+ * chain method for future
21
+ * @param onAbort
22
+ */
23
+ abortIf(onAbort: (cb: (reason?: any) => void) => void): this;
18
24
  /**
19
25
  * Aborts the request
20
26
  *
@@ -53,6 +53,20 @@ class Future extends Promise {
53
53
  }
54
54
  });
55
55
  }
56
+ /**
57
+ * Expose abort for other future to use.
58
+ * chain method for future
59
+ * @param onAbort
60
+ */
61
+ abortIf(onAbort) {
62
+ //to avoid "Illegal invocation" from lost context of this
63
+ const abort = (reason) => { this.abort(reason); };
64
+ onAbort(abort);
65
+ return this;
66
+ }
67
+ // then<TResult1 = T, TResult2 = never>(onfulfilled?: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2> {
68
+ // this.then();
69
+ // }
56
70
  /**
57
71
  * Aborts the request
58
72
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/fx-models",
3
3
  "license": "MIT",
4
- "version": "7.8.64-preview",
4
+ "version": "7.8.65-preview",
5
5
  "description": "Provide Omnia Fx Models Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"