synstate 3.0.0 → 3.0.1
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/dist/core/base/create-child-observable.mjs +164 -140
- package/dist/core/base/create-child-observable.mjs.map +1 -1
- package/dist/core/base/create-observable-base.mjs +148 -152
- package/dist/core/base/create-observable-base.mjs.map +1 -1
- package/dist/core/base/create-root-observable.mjs +48 -34
- package/dist/core/base/create-root-observable.mjs.map +1 -1
- package/dist/core/base/index.mjs +3 -3
- package/dist/core/base/index.mjs.map +1 -1
- package/dist/core/combine/combine.mjs +129 -37
- package/dist/core/combine/combine.mjs.map +1 -1
- package/dist/core/combine/index.mjs +4 -4
- package/dist/core/combine/index.mjs.map +1 -1
- package/dist/core/combine/merge.mjs +75 -24
- package/dist/core/combine/merge.mjs.map +1 -1
- package/dist/core/combine/zip.mjs +120 -39
- package/dist/core/combine/zip.mjs.map +1 -1
- package/dist/core/create/counter.mjs +81 -45
- package/dist/core/create/counter.mjs.map +1 -1
- package/dist/core/create/from-abortable-promise.mjs +63 -38
- package/dist/core/create/from-abortable-promise.mjs.map +1 -1
- package/dist/core/create/from-promise.mjs +67 -25
- package/dist/core/create/from-promise.mjs.map +1 -1
- package/dist/core/create/from-subscribable.mjs +70 -26
- package/dist/core/create/from-subscribable.mjs.map +1 -1
- package/dist/core/create/index.mjs +8 -8
- package/dist/core/create/index.mjs.map +1 -1
- package/dist/core/create/just.mjs +36 -13
- package/dist/core/create/just.mjs.map +1 -1
- package/dist/core/create/source.mjs +15 -19
- package/dist/core/create/source.mjs.map +1 -1
- package/dist/core/create/timer.mjs +66 -37
- package/dist/core/create/timer.mjs.map +1 -1
- package/dist/core/index.mjs +6 -41
- package/dist/core/index.mjs.map +1 -1
- package/dist/core/operators/audit.mjs +126 -39
- package/dist/core/operators/audit.mjs.map +1 -1
- package/dist/core/operators/debounce.mjs +114 -37
- package/dist/core/operators/debounce.mjs.map +1 -1
- package/dist/core/operators/filter.mjs +39 -24
- package/dist/core/operators/filter.mjs.map +1 -1
- package/dist/core/operators/index.mjs +18 -18
- package/dist/core/operators/index.mjs.map +1 -1
- package/dist/core/operators/map.mjs +74 -26
- package/dist/core/operators/map.mjs.map +1 -1
- package/dist/core/operators/merge-map.mjs +128 -35
- package/dist/core/operators/merge-map.mjs.map +1 -1
- package/dist/core/operators/pairwise.mjs +73 -23
- package/dist/core/operators/pairwise.mjs.map +1 -1
- package/dist/core/operators/scan.mjs +59 -15
- package/dist/core/operators/scan.mjs.map +1 -1
- package/dist/core/operators/skip-if-no-change.mjs +89 -31
- package/dist/core/operators/skip-if-no-change.mjs.map +1 -1
- package/dist/core/operators/skip-until.mjs +71 -29
- package/dist/core/operators/skip-until.mjs.map +1 -1
- package/dist/core/operators/skip-while.mjs +79 -27
- package/dist/core/operators/skip-while.mjs.map +1 -1
- package/dist/core/operators/switch-map.mjs +118 -31
- package/dist/core/operators/switch-map.mjs.map +1 -1
- package/dist/core/operators/take-until.mjs +70 -35
- package/dist/core/operators/take-until.mjs.map +1 -1
- package/dist/core/operators/take-while.mjs +97 -25
- package/dist/core/operators/take-while.mjs.map +1 -1
- package/dist/core/operators/throttle.mjs +108 -38
- package/dist/core/operators/throttle.mjs.map +1 -1
- package/dist/core/operators/with-buffered-from.mjs +94 -47
- package/dist/core/operators/with-buffered-from.mjs.map +1 -1
- package/dist/core/operators/with-current-value-from.mjs +78 -23
- package/dist/core/operators/with-current-value-from.mjs.map +1 -1
- package/dist/core/operators/with-initial-value.mjs +64 -14
- package/dist/core/operators/with-initial-value.mjs.map +1 -1
- package/dist/core/predefined/index.mjs +2 -12
- package/dist/core/predefined/index.mjs.map +1 -1
- package/dist/core/predefined/operators/attach-index.mjs +55 -7
- package/dist/core/predefined/operators/attach-index.mjs.map +1 -1
- package/dist/core/predefined/operators/index.mjs +12 -12
- package/dist/core/predefined/operators/index.mjs.map +1 -1
- package/dist/core/predefined/operators/map-optional.mjs +48 -5
- package/dist/core/predefined/operators/map-optional.mjs.map +1 -1
- package/dist/core/predefined/operators/map-result-err.mjs +48 -5
- package/dist/core/predefined/operators/map-result-err.mjs.map +1 -1
- package/dist/core/predefined/operators/map-result-ok.mjs +48 -5
- package/dist/core/predefined/operators/map-result-ok.mjs.map +1 -1
- package/dist/core/predefined/operators/map-to.mjs +41 -6
- package/dist/core/predefined/operators/map-to.mjs.map +1 -1
- package/dist/core/predefined/operators/pluck.mjs +45 -7
- package/dist/core/predefined/operators/pluck.mjs.map +1 -1
- package/dist/core/predefined/operators/skip.mjs +49 -6
- package/dist/core/predefined/operators/skip.mjs.map +1 -1
- package/dist/core/predefined/operators/take.mjs +42 -6
- package/dist/core/predefined/operators/take.mjs.map +1 -1
- package/dist/core/predefined/operators/unwrap-optional.mjs +43 -8
- package/dist/core/predefined/operators/unwrap-optional.mjs.map +1 -1
- package/dist/core/predefined/operators/unwrap-result-err.mjs +41 -5
- package/dist/core/predefined/operators/unwrap-result-err.mjs.map +1 -1
- package/dist/core/predefined/operators/unwrap-result-ok.mjs +43 -8
- package/dist/core/predefined/operators/unwrap-result-ok.mjs.map +1 -1
- package/dist/core/types/id.mjs +2 -2
- package/dist/core/types/id.mjs.map +1 -1
- package/dist/core/types/index.mjs +7 -3
- package/dist/core/types/index.mjs.map +1 -1
- package/dist/core/types/observable-family.mjs +14 -2
- package/dist/core/types/observable-family.mjs.map +1 -1
- package/dist/core/types/observable-kind.mjs +2 -2
- package/dist/core/types/observable-kind.mjs.map +1 -1
- package/dist/core/types/observable.mjs +14 -6
- package/dist/core/types/observable.mjs.map +1 -1
- package/dist/core/types/timer.mjs +2 -2
- package/dist/core/types/timer.mjs.map +1 -1
- package/dist/core/types/types.mjs +9 -2
- package/dist/core/types/types.mjs.map +1 -1
- package/dist/core/utils/id-maker.mjs +10 -11
- package/dist/core/utils/id-maker.mjs.map +1 -1
- package/dist/core/utils/index.mjs +5 -5
- package/dist/core/utils/index.mjs.map +1 -1
- package/dist/core/utils/max-depth.mjs +7 -4
- package/dist/core/utils/max-depth.mjs.map +1 -1
- package/dist/core/utils/observable-utils.mjs +4 -7
- package/dist/core/utils/observable-utils.mjs.map +1 -1
- package/dist/core/utils/utils.mjs +32 -28
- package/dist/core/utils/utils.mjs.map +1 -1
- package/dist/entry-point.mjs +2 -46
- package/dist/entry-point.mjs.map +1 -1
- package/dist/index.mjs +3 -46
- package/dist/index.mjs.map +1 -1
- package/dist/utils/collect-to-array.mjs +8 -13
- package/dist/utils/collect-to-array.mjs.map +1 -1
- package/dist/utils/create-boolean-state.mjs +47 -22
- package/dist/utils/create-boolean-state.mjs.map +1 -1
- package/dist/utils/create-event-emitter.mjs +67 -19
- package/dist/utils/create-event-emitter.mjs.map +1 -1
- package/dist/utils/create-reducer.mjs +54 -16
- package/dist/utils/create-reducer.mjs.map +1 -1
- package/dist/utils/create-state.mjs +54 -27
- package/dist/utils/create-state.mjs.map +1 -1
- package/dist/utils/index.mjs +6 -6
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +11 -12
|
@@ -1,49 +1,96 @@
|
|
|
1
|
-
import { Optional, pipe
|
|
2
|
-
import { createSyncChildObservable } from '../base/
|
|
3
|
-
import '../utils/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { Arr, Optional, pipe } from 'ts-data-forge';
|
|
2
|
+
import { createSyncChildObservable } from '../base/index.mjs';
|
|
3
|
+
import { maxDepth } from '../utils/index.mjs';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
export const withBufferedFrom = (observable) =>
|
|
58
|
+
|
|
59
|
+
((parentObservable) => createWithBufferedFromObservable(parentObservable, observable));
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
export const withBuffered = withBufferedFrom;
|
|
14
65
|
const createWithBufferedFromObservable = (parentObservable, observable) => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
me
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
45
|
-
return result;
|
|
66
|
+
let mut_bufferedValues = [];
|
|
67
|
+
const clearBuffer = () => {
|
|
68
|
+
mut_bufferedValues = [];
|
|
69
|
+
};
|
|
70
|
+
const result = createSyncChildObservable({
|
|
71
|
+
parents: [parentObservable],
|
|
72
|
+
depth: 1 + maxDepth([parentObservable, observable]),
|
|
73
|
+
initialValue: pipe({
|
|
74
|
+
par: parentObservable.getSnapshot(),
|
|
75
|
+
me: observable.getSnapshot(),
|
|
76
|
+
}).map(({ par, me }) => Optional.isNone(par)
|
|
77
|
+
? Optional.none
|
|
78
|
+
: Optional.some([
|
|
79
|
+
par.value,
|
|
80
|
+
Optional.isNone(me) ? [] : [me.value],
|
|
81
|
+
])).value,
|
|
82
|
+
}, ({ setNext }) => (updateToken) => {
|
|
83
|
+
const sn = parentObservable.getSnapshot();
|
|
84
|
+
if (parentObservable.updateToken !== updateToken ||
|
|
85
|
+
Optional.isNone(sn)) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
setNext([sn.value, mut_bufferedValues], updateToken);
|
|
89
|
+
clearBuffer();
|
|
90
|
+
});
|
|
91
|
+
observable.subscribe((value) => {
|
|
92
|
+
mut_bufferedValues = Arr.toPushed(mut_bufferedValues, value);
|
|
93
|
+
});
|
|
94
|
+
return result;
|
|
46
95
|
};
|
|
47
|
-
|
|
48
|
-
export { withBuffered, withBufferedFrom };
|
|
49
|
-
//# sourceMappingURL=with-buffered-from.mjs.map
|
|
96
|
+
//# sourceMappingURL=with-buffered-from.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-buffered-from.mjs","sources":["../../../src/core/operators/with-buffered-from.mts"],"
|
|
1
|
+
{"version":3,"file":"with-buffered-from.mjs","sourceRoot":"","sources":["../../../src/core/operators/with-buffered-from.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAM9D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,UAAyB,EACgC,EAAE;AAC3D,oEAAoE;AACpE,CAAC,CAAC,gBAAgB,EAAE,EAAE,CACpB,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;QAED,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,EAAE,WAAW,CAAC,CAAC;QAErD,WAAW,EAAE,CAAC;IAChB,CAAC,CACJ,CAAC;IAEF,UAAU,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;QAC7B,kBAAkB,GAAG,GAAG,CAAC,QAAQ,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -1,31 +1,86 @@
|
|
|
1
1
|
import { Optional, pipe } from 'ts-data-forge';
|
|
2
|
-
import { createSyncChildObservable } from '../base/
|
|
3
|
-
import '../utils/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { createSyncChildObservable } from '../base/index.mjs';
|
|
3
|
+
import { maxDepth } from '../utils/index.mjs';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
export const withCurrentValueFrom = (observable) => (parentObservable) => createWithCurrentValueFromObservable(parentObservable, observable);
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
export const withLatestFrom = withCurrentValueFrom;
|
|
66
|
+
const createWithCurrentValueFromObservable = (parentObservable, observable) => createSyncChildObservable({
|
|
10
67
|
parents: [parentObservable],
|
|
11
68
|
depth: 1 + maxDepth([parentObservable, observable]),
|
|
12
69
|
initialValue: pipe({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}).map(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
({ setNext }) => (updateToken) => {
|
|
70
|
+
par: parentObservable.getSnapshot(),
|
|
71
|
+
me: observable.getSnapshot(),
|
|
72
|
+
}).map(({ me, par }) => Optional.isNone(par) || Optional.isNone(me)
|
|
73
|
+
? Optional.none
|
|
74
|
+
: Optional.some([par.value, me.value])).value,
|
|
75
|
+
}, ({ setNext }) => (updateToken) => {
|
|
20
76
|
const ps = parentObservable.getSnapshot();
|
|
21
|
-
if (parentObservable.updateToken !== updateToken ||
|
|
22
|
-
|
|
77
|
+
if (parentObservable.updateToken !== updateToken ||
|
|
78
|
+
Optional.isNone(ps)) {
|
|
79
|
+
return;
|
|
23
80
|
}
|
|
24
81
|
const curr = observable.getSnapshot();
|
|
25
|
-
if (Optional.isNone(curr))
|
|
82
|
+
if (Optional.isNone(curr))
|
|
83
|
+
return;
|
|
26
84
|
setNext([ps.value, curr.value], updateToken);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export { withCurrentValueFrom, withLatestFrom };
|
|
31
|
-
//# sourceMappingURL=with-current-value-from.mjs.map
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=with-current-value-from.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-current-value-from.mjs","sources":["../../../src/core/operators/with-current-value-from.mts"],"
|
|
1
|
+
{"version":3,"file":"with-current-value-from.mjs","sourceRoot":"","sources":["../../../src/core/operators/with-current-value-from.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAM9D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,CACE,UAAyB,EACqB,EAAE,CAClD,CAAC,gBAAgB,EAAE,EAAE,CACnB,oCAAoC,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;AAEvE;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAEnD,MAAM,oCAAoC,GAAG,CAC3C,gBAA+B,EAC/B,UAAyB,EACqB,EAAE,CAChD,yBAAyB,CACvB;IACE,OAAO,EAAE,CAAC,gBAAgB,CAAC;IAC3B,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;IACnD,YAAY,EAAE,IAAI,CAAC;QACjB,GAAG,EAAE,gBAAgB,CAAC,WAAW,EAAE;QACnC,EAAE,EAAE,UAAU,CAAC,WAAW,EAAE;KAC7B,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CACrB,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,CAAC,CAAC,QAAQ,CAAC,IAAI;QACf,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAU,CAAC,CAClD,CAAC,KAAK;CACR,EACD,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CACd,CAAC,WAAW,EAAE,EAAE;IACd,MAAM,EAAE,GAAG,gBAAgB,CAAC,WAAW,EAAE,CAAC;IAE1C,IACE,gBAAgB,CAAC,WAAW,KAAK,WAAW;QAC5C,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EACnB,CAAC;QACD,OAAO,CAAC,cAAc;IACxB,CAAC;IAED,MAAM,IAAI,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;IAEtC,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,cAAc;IAEjD,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC;AAC/C,CAAC,CACJ,CAAC"}
|
|
@@ -1,21 +1,71 @@
|
|
|
1
1
|
import { Optional } from 'ts-data-forge';
|
|
2
|
-
import { createInitializedSyncChildObservable } from '../base/
|
|
3
|
-
import '../utils/id-maker.mjs';
|
|
2
|
+
import { createInitializedSyncChildObservable } from '../base/index.mjs';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
export const withInitialValue = (initialValue) => (parentObservable) => createWithInitialValueObservable(parentObservable, initialValue);
|
|
50
|
+
const createWithInitialValueObservable = (parentObservable, initialValue) => createInitializedSyncChildObservable({
|
|
8
51
|
parents: [parentObservable],
|
|
9
|
-
initialValue: Optional.some(initialValue)
|
|
10
|
-
|
|
11
|
-
({ setNext }) => (updateToken) => {
|
|
52
|
+
initialValue: Optional.some(initialValue),
|
|
53
|
+
}, ({ setNext }) => (updateToken) => {
|
|
12
54
|
const sn = parentObservable.getSnapshot();
|
|
13
|
-
if (parentObservable.updateToken !== updateToken ||
|
|
14
|
-
|
|
55
|
+
if (parentObservable.updateToken !== updateToken ||
|
|
56
|
+
Optional.isNone(sn)) {
|
|
57
|
+
return;
|
|
15
58
|
}
|
|
16
59
|
setNext(sn.value, updateToken);
|
|
17
|
-
|
|
18
|
-
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
19
70
|
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=with-initial-value.mjs.map
|
|
71
|
+
//# sourceMappingURL=with-initial-value.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-initial-value.mjs","sources":["../../../src/core/operators/with-initial-value.mts"],"
|
|
1
|
+
{"version":3,"file":"with-initial-value.mjs","sourceRoot":"","sources":["../../../src/core/operators/with-initial-value.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,oCAAoC,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;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js';
|
|
5
|
-
export { mapTo } from './operators/map-to.mjs';
|
|
6
|
-
export { getKey, pluck } from './operators/pluck.mjs';
|
|
7
|
-
export { skip } from './operators/skip.mjs';
|
|
8
|
-
export { take } from './operators/take.mjs';
|
|
9
|
-
export { unwrapOptional } from './operators/unwrap-optional.mjs';
|
|
10
|
-
export { unwrapResultErr } from './operators/unwrap-result-err.mjs';
|
|
11
|
-
export { unwrapResultOk } from './operators/unwrap-result-ok.mjs';
|
|
12
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
export * from './operators/index.mjs';
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/core/predefined/index.mts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -1,9 +1,57 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../utils/id-maker.mjs';
|
|
3
|
-
import { map } from '../../operators/map.mjs';
|
|
1
|
+
import { map } from '../../operators/index.mjs';
|
|
4
2
|
|
|
5
|
-
const withIndex = () => map((a, i) => [i, a]);
|
|
6
|
-
const attachIndex = withIndex;
|
|
7
3
|
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
export const withIndex = () => map((a, i) => [i, a]);
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
export const attachIndex = withIndex;
|
|
57
|
+
//# sourceMappingURL=attach-index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attach-index.mjs","sources":["../../../../src/core/predefined/operators/attach-index.mts"],"
|
|
1
|
+
{"version":3,"file":"attach-index.mjs","sourceRoot":"","sources":["../../../../src/core/predefined/operators/attach-index.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAGhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,GAGvB,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAU,CAAC,CAAC;AAEpC;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
export * from './attach-index.mjs';
|
|
2
|
+
export * from './map-optional.mjs';
|
|
3
|
+
export * from './map-result-err.mjs';
|
|
4
|
+
export * from './map-result-ok.mjs';
|
|
5
|
+
export * from './map-to.mjs';
|
|
6
|
+
export * from './pluck.mjs';
|
|
7
|
+
export * from './skip.mjs';
|
|
8
|
+
export * from './take.mjs';
|
|
9
|
+
export * from './unwrap-optional.mjs';
|
|
10
|
+
export * from './unwrap-result-err.mjs';
|
|
11
|
+
export * from './unwrap-result-ok.mjs';
|
|
12
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/core/predefined/operators/index.mts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC"}
|
|
@@ -1,8 +1,51 @@
|
|
|
1
1
|
import { Optional } from 'ts-data-forge';
|
|
2
|
-
import '../../
|
|
3
|
-
import { map } from '../../operators/map.mjs';
|
|
2
|
+
import { map } from '../../operators/index.mjs';
|
|
4
3
|
|
|
5
|
-
const mapOptional = (mapFn) => map(Optional.map(mapFn));
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
export const mapOptional = (mapFn) => map(Optional.map(mapFn));
|
|
51
|
+
//# sourceMappingURL=map-optional.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-optional.mjs","sources":["../../../../src/core/predefined/operators/map-optional.mts"],"
|
|
1
|
+
{"version":3,"file":"map-optional.mjs","sourceRoot":"","sources":["../../../../src/core/predefined/operators/map-optional.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwB,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAGhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,KAAmC,EACO,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC"}
|
|
@@ -1,8 +1,51 @@
|
|
|
1
1
|
import { Result } from 'ts-data-forge';
|
|
2
|
-
import '../../
|
|
3
|
-
import { map } from '../../operators/map.mjs';
|
|
2
|
+
import { map } from '../../operators/index.mjs';
|
|
4
3
|
|
|
5
|
-
const mapResultErr = (mapFn) => map(Result.mapErr(mapFn));
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
export const mapResultErr = (mapFn) => map(Result.mapErr(mapFn));
|
|
51
|
+
//# sourceMappingURL=map-result-err.mjs.map
|