flinker 2.0.4 → 2.0.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/README.md +6 -6
- package/dist/esm/RXPublisher.js +7 -0
- package/dist/types/RXPublisher.d.ts +1 -0
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -51,9 +51,9 @@ let buffer1 = ''
|
|
|
51
51
|
let buffer2 = ''
|
|
52
52
|
|
|
53
53
|
op.pipe()
|
|
54
|
-
.onReceive(v =>
|
|
55
|
-
.onError(() =>
|
|
56
|
-
.onComplete(() =>
|
|
54
|
+
.onReceive(v => buffer1 += v + '')
|
|
55
|
+
.onError(() => buffer1 += 'e')
|
|
56
|
+
.onComplete(() => buffer1 += 'c')
|
|
57
57
|
.subscribe()
|
|
58
58
|
|
|
59
59
|
op.fail()
|
|
@@ -62,9 +62,9 @@ op.success(10) // no effect
|
|
|
62
62
|
op.success(20) // no effect
|
|
63
63
|
|
|
64
64
|
op.pipe()
|
|
65
|
-
.onReceive(value =>
|
|
66
|
-
.onError(() =>
|
|
67
|
-
.onComplete(() =>
|
|
65
|
+
.onReceive(value => buffer2 += value + '')
|
|
66
|
+
.onError(() => buffer2 += 'e')
|
|
67
|
+
.onComplete(() => buffer2 += 'c')
|
|
68
68
|
.subscribe()
|
|
69
69
|
|
|
70
70
|
expect(buffer1).toBe('ec') // true
|
package/dist/esm/RXPublisher.js
CHANGED
|
@@ -279,6 +279,13 @@ export class RXOperation extends RXPublisher {
|
|
|
279
279
|
super.sendError(e);
|
|
280
280
|
super.sendComplete();
|
|
281
281
|
}
|
|
282
|
+
get asAwaitable() {
|
|
283
|
+
return new Promise((resolve, reject) => {
|
|
284
|
+
this.pipe()
|
|
285
|
+
.onReceive(v => resolve(v))
|
|
286
|
+
.onError(e => reject(e));
|
|
287
|
+
});
|
|
288
|
+
}
|
|
282
289
|
didSubscribe(p) {
|
|
283
290
|
if (!this.isComplete)
|
|
284
291
|
return;
|
|
@@ -91,6 +91,7 @@ export declare class RXOperation<V, E> extends RXPublisher<V, E> {
|
|
|
91
91
|
get err(): E | undefined;
|
|
92
92
|
success(value: V): void;
|
|
93
93
|
fail(e: E): void;
|
|
94
|
+
get asAwaitable(): Promise<V>;
|
|
94
95
|
didSubscribe(p: RXAnyPipeline): void;
|
|
95
96
|
}
|
|
96
97
|
export declare class RXCombine extends RXPublisher<any[], any> {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flinker",
|
|
3
3
|
"description": "RX.ts lib for building frontend apps",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.6",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/Dittner/Flinker.git"
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"README.md"
|
|
26
26
|
],
|
|
27
27
|
"scripts": {
|
|
28
|
-
"demo": "PORT=3001 PUBLIC_URL=/ react-scripts start",
|
|
29
28
|
"test": "jest",
|
|
30
29
|
"build": "rm -rf dist && npm run build:esm",
|
|
31
30
|
"build:esm": "tsc --module es2020 --target es2020 --outDir dist/esm",
|