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,29 +1,73 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { Optional, Result } from 'ts-data-forge';
|
|
2
|
+
import { createRootObservable } from '../base/index.mjs';
|
|
3
|
+
|
|
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
|
+
|
|
61
|
+
export const fromSubscribable = (subscribable) => createRootObservable({ initialValue: Optional.none }, ({ startUpdate, complete }) => {
|
|
62
|
+
subscribable.subscribe((nextValue) => {
|
|
10
63
|
startUpdate(Result.ok(nextValue));
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
error
|
|
17
|
-
)
|
|
18
|
-
);
|
|
19
|
-
},
|
|
20
|
-
() => {
|
|
64
|
+
}, (error) => {
|
|
65
|
+
startUpdate(Result.err(
|
|
66
|
+
|
|
67
|
+
error));
|
|
68
|
+
}, () => {
|
|
21
69
|
complete();
|
|
22
|
-
|
|
23
|
-
);
|
|
70
|
+
});
|
|
24
71
|
return {};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export { fromSubscribable };
|
|
29
|
-
//# sourceMappingURL=from-subscribable.mjs.map
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=from-subscribable.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"from-subscribable.mjs","sources":["../../../src/core/create/from-subscribable.mts"],"
|
|
1
|
+
{"version":3,"file":"from-subscribable.mjs","sourceRoot":"","sources":["../../../src/core/create/from-subscribable.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAMzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,YAA6B,EACK,EAAE,CACpC,oBAAoB,CAClB,EAAE,YAAY,EAAE,QAAQ,CAAC,IAAI,EAAE,EAC/B,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC5B,YAAY,CAAC,SAAS,CACpB,CAAC,SAAS,EAAE,EAAE;QACZ,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IACpC,CAAC,EACD,CAAC,KAAe,EAAE,EAAE;QAClB,WAAW,CACT,MAAM,CAAC,GAAG;QACR,oEAAoE;QACpE,KAAU,CACX,CACF,CAAC;IACJ,CAAC,EACD,GAAG,EAAE;QACH,QAAQ,EAAE,CAAC;IACb,CAAC,CACF,CAAC;IAEF,OAAO,EAAE,CAAC;AACZ,CAAC,CACF,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
export * from './counter.mjs';
|
|
2
|
+
export * from './from-abortable-promise.mjs';
|
|
3
|
+
export * from './from-promise.mjs';
|
|
4
|
+
export * from './from-subscribable.mjs';
|
|
5
|
+
export * from './just.mjs';
|
|
6
|
+
export * from './source.mjs';
|
|
7
|
+
export * from './timer.mjs';
|
|
8
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/core/create/index.mts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
|
@@ -1,15 +1,38 @@
|
|
|
1
1
|
import { Optional } from 'ts-data-forge';
|
|
2
|
-
import '../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { createRootObservable } from '../base/index.mjs';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export const just = (value) => {
|
|
33
|
+
const obs = createRootObservable({ initialValue: Optional.some(value) }, () => ({}));
|
|
34
|
+
obs.complete();
|
|
35
|
+
|
|
36
|
+
return obs;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=just.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"just.mjs","sources":["../../../src/core/create/just.mts"],"
|
|
1
|
+
{"version":3,"file":"just.mjs","sourceRoot":"","sources":["../../../src/core/create/just.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAW,KAAQ,EAAgC,EAAE;IACvE,MAAM,GAAG,GAAG,oBAAoB,CAC9B,EAAE,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EACtC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CACX,CAAC;IAEF,GAAG,CAAC,QAAQ,EAAE,CAAC;IAEf,oEAAoE;IACpE,OAAO,GAAmC,CAAC;AAC7C,CAAC,CAAC"}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})
|
|
16
|
-
);
|
|
1
|
+
import { Arr, Optional } from 'ts-data-forge';
|
|
2
|
+
import { createRootObservable } from '../base/index.mjs';
|
|
3
|
+
export function source(...args) {
|
|
4
|
+
return createRootObservable({
|
|
5
|
+
initialValue: Arr.isNonEmpty(args)
|
|
6
|
+
? Optional.some(args[0])
|
|
7
|
+
: Optional.none,
|
|
8
|
+
}, ({ startUpdate, isCompleted }) => ({
|
|
9
|
+
next: (nextValue) => {
|
|
10
|
+
if (isCompleted())
|
|
11
|
+
return;
|
|
12
|
+
startUpdate(nextValue);
|
|
13
|
+
},
|
|
14
|
+
}));
|
|
17
15
|
}
|
|
18
|
-
|
|
19
|
-
export { source };
|
|
20
|
-
//# sourceMappingURL=source.mjs.map
|
|
16
|
+
//# sourceMappingURL=source.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.mjs","sources":["../../../src/core/create/source.mts"],"
|
|
1
|
+
{"version":3,"file":"source.mjs","sourceRoot":"","sources":["../../../src/core/create/source.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAmDzD,MAAM,UAAU,MAAM,CAAU,GAAG,IAAkB;IACnD,OAAO,oBAAoB,CACzB;QACE,YAAY,EAAE,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;YAChC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACxB,CAAC,CAAC,QAAQ,CAAC,IAAI;KAClB,EACD,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;QACjC,IAAI,EAAE,CAAC,SAAY,EAAE,EAAE;YACrB,IAAI,WAAW,EAAE;gBAAE,OAAO;YAE1B,WAAW,CAAC,SAAS,CAAC,CAAC;QACzB,CAAC;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,40 +1,69 @@
|
|
|
1
1
|
import { Optional } from 'ts-data-forge';
|
|
2
|
-
import '../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
import { createRootObservable } from '../base/index.mjs';
|
|
3
|
+
|
|
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
|
+
export const timer = (milliSeconds, options) => {
|
|
40
|
+
let mut_timerId = undefined;
|
|
41
|
+
let mut_isStarted = false;
|
|
42
|
+
const resetTimer = () => {
|
|
43
|
+
if (mut_timerId !== undefined) {
|
|
44
|
+
clearTimeout(mut_timerId);
|
|
25
45
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
46
|
+
};
|
|
47
|
+
const observable = createRootObservable({ initialValue: Optional.none, onComplete: resetTimer }, ({ startUpdate, isCompleted, complete }) => ({
|
|
48
|
+
start: () => {
|
|
49
|
+
if (mut_isStarted) {
|
|
50
|
+
console.warn('cannot start twice');
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
mut_isStarted = true;
|
|
54
|
+
if (isCompleted()) {
|
|
55
|
+
console.warn('cannot restart stopped TimerObservable');
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
mut_timerId = setTimeout(() => {
|
|
59
|
+
startUpdate(0);
|
|
60
|
+
complete();
|
|
61
|
+
}, milliSeconds);
|
|
62
|
+
},
|
|
63
|
+
}));
|
|
64
|
+
if (!(options?.startManually ?? false)) {
|
|
65
|
+
observable.start();
|
|
66
|
+
}
|
|
67
|
+
return observable;
|
|
37
68
|
};
|
|
38
|
-
|
|
39
|
-
export { timer };
|
|
40
|
-
//# sourceMappingURL=timer.mjs.map
|
|
69
|
+
//# sourceMappingURL=timer.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timer.mjs","sources":["../../../src/core/create/timer.mts"],"
|
|
1
|
+
{"version":3,"file":"timer.mjs","sourceRoot":"","sources":["../../../src/core/create/timer.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,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,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
export { fromSubscribable } from './create/from-subscribable.mjs';
|
|
8
|
-
export { just } from './create/just.mjs';
|
|
9
|
-
export { source } from './create/source.mjs';
|
|
10
|
-
export { timer } from './create/timer.mjs';
|
|
11
|
-
export { audit } from './operators/audit.mjs';
|
|
12
|
-
export { debounce } from './operators/debounce.mjs';
|
|
13
|
-
export { filter } from './operators/filter.mjs';
|
|
14
|
-
export { map } from './operators/map.mjs';
|
|
15
|
-
export { flatMap, mergeMap } from './operators/merge-map.mjs';
|
|
16
|
-
export { pairwise } from './operators/pairwise.mjs';
|
|
17
|
-
export { scan } from './operators/scan.mjs';
|
|
18
|
-
export { distinctUntilChanged, skipIfNoChange } from './operators/skip-if-no-change.mjs';
|
|
19
|
-
export { skipUntil } from './operators/skip-until.mjs';
|
|
20
|
-
export { skipWhile } from './operators/skip-while.mjs';
|
|
21
|
-
export { switchMap } from './operators/switch-map.mjs';
|
|
22
|
-
export { takeUntil } from './operators/take-until.mjs';
|
|
23
|
-
export { takeWhile } from './operators/take-while.mjs';
|
|
24
|
-
export { throttle } from './operators/throttle.mjs';
|
|
25
|
-
export { withBuffered, withBufferedFrom } from './operators/with-buffered-from.mjs';
|
|
26
|
-
export { withCurrentValueFrom, withLatestFrom } from './operators/with-current-value-from.mjs';
|
|
27
|
-
export { withInitialValue } from './operators/with-initial-value.mjs';
|
|
28
|
-
export { attachIndex, withIndex } from './predefined/operators/attach-index.mjs';
|
|
29
|
-
export { mapOptional } from './predefined/operators/map-optional.mjs';
|
|
30
|
-
export { mapResultErr } from './predefined/operators/map-result-err.mjs';
|
|
31
|
-
export { mapResultOk } from './predefined/operators/map-result-ok.mjs';
|
|
32
|
-
export { mapTo } from './predefined/operators/map-to.mjs';
|
|
33
|
-
export { getKey, pluck } from './predefined/operators/pluck.mjs';
|
|
34
|
-
export { skip } from './predefined/operators/skip.mjs';
|
|
35
|
-
export { take } from './predefined/operators/take.mjs';
|
|
36
|
-
export { unwrapOptional } from './predefined/operators/unwrap-optional.mjs';
|
|
37
|
-
export { unwrapResultErr } from './predefined/operators/unwrap-result-err.mjs';
|
|
38
|
-
export { unwrapResultOk } from './predefined/operators/unwrap-result-ok.mjs';
|
|
39
|
-
import 'ts-data-forge';
|
|
40
|
-
export { isChildObservable, isManagerObservable, isRootObservable } from './types/observable.mjs';
|
|
41
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
export * from './combine/index.mjs';
|
|
2
|
+
export * from './create/index.mjs';
|
|
3
|
+
export * from './operators/index.mjs';
|
|
4
|
+
export * from './predefined/index.mjs';
|
|
5
|
+
export * from './types/index.mjs';
|
|
6
|
+
//# sourceMappingURL=index.mjs.map
|
package/dist/core/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/core/index.mts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,42 +1,129 @@
|
|
|
1
1
|
import { Optional } from 'ts-data-forge';
|
|
2
|
-
import { createAsyncChildObservable } from '../base/
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import { createAsyncChildObservable } from '../base/index.mjs';
|
|
3
|
+
|
|
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
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
export const audit = (milliSeconds) =>
|
|
98
|
+
|
|
99
|
+
((parentObservable) => createAuditObservable(parentObservable, milliSeconds));
|
|
12
100
|
const createAuditObservable = (parentObservable, milliSeconds) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
mut_isSkipping = true;
|
|
31
|
-
mut_timerId = setTimeout(() => {
|
|
32
|
-
const sn = parentObservable.getSnapshot();
|
|
33
|
-
if (Optional.isNone(sn)) return;
|
|
34
|
-
startUpdate(sn.value);
|
|
35
|
-
mut_isSkipping = false;
|
|
36
|
-
}, milliSeconds);
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
};
|
|
101
|
+
let mut_timerId = undefined;
|
|
102
|
+
let mut_isSkipping = false;
|
|
103
|
+
const resetTimer = () => {
|
|
104
|
+
if (mut_timerId !== undefined) {
|
|
105
|
+
clearTimeout(mut_timerId);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
return createAsyncChildObservable({
|
|
109
|
+
parents: [parentObservable],
|
|
110
|
+
initialValue: parentObservable.getSnapshot(),
|
|
111
|
+
onComplete: resetTimer,
|
|
112
|
+
}, ({ startUpdate }) => (updateToken) => {
|
|
113
|
+
if (mut_isSkipping ||
|
|
114
|
+
parentObservable.updateToken !== updateToken ||
|
|
115
|
+
Optional.isNone(parentObservable.getSnapshot())) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
40
118
|
|
|
41
|
-
|
|
42
|
-
|
|
119
|
+
mut_isSkipping = true;
|
|
120
|
+
mut_timerId = setTimeout(() => {
|
|
121
|
+
const sn = parentObservable.getSnapshot();
|
|
122
|
+
if (Optional.isNone(sn))
|
|
123
|
+
return;
|
|
124
|
+
startUpdate(sn.value);
|
|
125
|
+
mut_isSkipping = false;
|
|
126
|
+
}, milliSeconds);
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
//# sourceMappingURL=audit.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.mjs","sources":["../../../src/core/operators/audit.mts"],"
|
|
1
|
+
{"version":3,"file":"audit.mjs","sourceRoot":"","sources":["../../../src/core/operators/audit.mts"],"names":[],"mappings":"AAAA,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