@dereekb/rxjs 13.11.13 → 13.11.15
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/index.cjs.js +478 -442
- package/index.esm.js +478 -442
- package/package.json +2 -2
- package/src/lib/asset/asset.builder.d.ts +14 -14
- package/src/lib/asset/asset.loader.d.ts +7 -7
- package/src/lib/asset/asset.loader.delegated.d.ts +3 -3
- package/src/lib/asset/asset.loader.fetch.d.ts +3 -3
- package/src/lib/asset/asset.loader.memory.d.ts +3 -3
- package/src/lib/filter/filter.map.d.ts +12 -12
- package/src/lib/filter/filter.preset.d.ts +5 -4
- package/src/lib/filter/filter.source.d.ts +4 -4
- package/src/lib/iterator/iteration.accumulator.d.ts +3 -4
- package/src/lib/iterator/iteration.accumulator.rxjs.d.ts +8 -8
- package/src/lib/iterator/iteration.mapped.d.ts +4 -4
- package/src/lib/iterator/iteration.mapped.page.d.ts +3 -3
- package/src/lib/iterator/iteration.next.d.ts +11 -13
- package/src/lib/iterator/iterator.page.d.ts +4 -4
- package/src/lib/loading/loading.context.rxjs.d.ts +2 -2
- package/src/lib/loading/loading.context.simple.d.ts +4 -4
- package/src/lib/loading/loading.context.state.d.ts +6 -6
- package/src/lib/loading/loading.context.state.list.d.ts +3 -3
- package/src/lib/loading/loading.state.d.ts +68 -68
- package/src/lib/loading/loading.state.list.d.ts +12 -12
- package/src/lib/loading/loading.state.rxjs.d.ts +18 -18
- package/src/lib/lock.d.ts +25 -25
- package/src/lib/object.d.ts +1 -1
- package/src/lib/rxjs/array.d.ts +7 -7
- package/src/lib/rxjs/boolean.d.ts +6 -6
- package/src/lib/rxjs/decision.d.ts +6 -6
- package/src/lib/rxjs/delta.d.ts +7 -7
- package/src/lib/rxjs/expires.d.ts +13 -13
- package/src/lib/rxjs/factory.d.ts +7 -7
- package/src/lib/rxjs/getter.d.ts +4 -4
- package/src/lib/rxjs/key.d.ts +4 -4
- package/src/lib/rxjs/lifecycle.d.ts +5 -5
- package/src/lib/rxjs/loading.d.ts +2 -2
- package/src/lib/rxjs/map.d.ts +3 -3
- package/src/lib/rxjs/misc.d.ts +6 -5
- package/src/lib/rxjs/model.d.ts +2 -2
- package/src/lib/rxjs/number.d.ts +4 -4
- package/src/lib/rxjs/rxjs.async.d.ts +5 -5
- package/src/lib/rxjs/rxjs.d.ts +12 -12
- package/src/lib/rxjs/rxjs.error.d.ts +3 -3
- package/src/lib/rxjs/rxjs.map.d.ts +11 -11
- package/src/lib/rxjs/rxjs.unique.d.ts +3 -3
- package/src/lib/rxjs/set.d.ts +12 -12
- package/src/lib/rxjs/string.d.ts +3 -3
- package/src/lib/rxjs/timeout.d.ts +9 -9
- package/src/lib/rxjs/use.d.ts +2 -2
- package/src/lib/rxjs/value.d.ts +49 -45
- package/src/lib/subscription.d.ts +7 -7
- package/src/lib/work/work.factory.d.ts +8 -6
- package/src/lib/work/work.instance.d.ts +9 -8
package/src/lib/rxjs/array.d.ts
CHANGED
|
@@ -55,15 +55,15 @@ export type ScanBuildArrayConfigFn<S, T> = (seedState: S) => ScanBuildArrayConfi
|
|
|
55
55
|
* are incrementally appended. Useful when loading large datasets where the initial page and
|
|
56
56
|
* subsequent pages come from different sources.
|
|
57
57
|
*
|
|
58
|
-
* @param init -
|
|
59
|
-
* @returns
|
|
58
|
+
* @param init - Function that receives the seed state and returns the accumulator config.
|
|
59
|
+
* @returns An operator that emits the growing array.
|
|
60
60
|
*/
|
|
61
61
|
export declare function scanBuildArray<S, T>(init: ScanBuildArrayConfigFn<S, T>): OperatorFunction<S, T[]>;
|
|
62
62
|
/**
|
|
63
63
|
* RxJS operator that executes a side-effect on each element of the emitted array, then passes the array through.
|
|
64
64
|
*
|
|
65
|
-
* @param forEach -
|
|
66
|
-
* @returns
|
|
65
|
+
* @param forEach - Callback to run for each element, or null/undefined to pass through unchanged.
|
|
66
|
+
* @returns An operator that taps each element in emitted arrays.
|
|
67
67
|
*/
|
|
68
68
|
export declare function mapForEach<T>(forEach: Maybe<(value: T) => void>): MonoTypeOperatorFunction<T[]>;
|
|
69
69
|
export interface MapEachAsyncConfig {
|
|
@@ -78,8 +78,8 @@ export interface MapEachAsyncConfig {
|
|
|
78
78
|
*
|
|
79
79
|
* Emits `[]` for empty arrays. When `onlyFirst` is true, takes only the first combined emission.
|
|
80
80
|
*
|
|
81
|
-
* @param mapFunction -
|
|
82
|
-
* @param config -
|
|
83
|
-
* @returns
|
|
81
|
+
* @param mapFunction - Function that maps each item to an ObservableInput.
|
|
82
|
+
* @param config - Optional config (e.g., `onlyFirst`)
|
|
83
|
+
* @returns An operator that async-maps each array element.
|
|
84
84
|
*/
|
|
85
85
|
export declare function mapEachAsync<I, O>(mapFunction: MapFunction<I, ObservableInput<O>>, config?: MapEachAsyncConfig): OperatorFunction<I[], O[]>;
|
|
@@ -2,26 +2,26 @@ import { type OperatorFunction, type MonoTypeOperatorFunction } from 'rxjs';
|
|
|
2
2
|
/**
|
|
3
3
|
* Conditionally applies an operator. Returns the given pipe when `usePipe` is true, otherwise returns identity (pass-through).
|
|
4
4
|
*
|
|
5
|
-
* @param usePipe -
|
|
6
|
-
* @param pipe -
|
|
7
|
-
* @returns
|
|
5
|
+
* @param usePipe - Whether to apply the pipe.
|
|
6
|
+
* @param pipe - The operator to conditionally apply.
|
|
7
|
+
* @returns The pipe or identity operator.
|
|
8
8
|
*/
|
|
9
9
|
export declare function pipeIf<A>(usePipe: boolean, pipe: OperatorFunction<A, A>): OperatorFunction<A, A>;
|
|
10
10
|
/**
|
|
11
11
|
* RxJS operator that negates each emitted boolean value.
|
|
12
12
|
*
|
|
13
|
-
* @returns
|
|
13
|
+
* @returns Operator that maps each boolean emission to its negated value.
|
|
14
14
|
*/
|
|
15
15
|
export declare function isNot(): MonoTypeOperatorFunction<boolean>;
|
|
16
16
|
/**
|
|
17
17
|
* RxJS operator that only emits when a boolean stream transitions from `true` to `false`.
|
|
18
18
|
*
|
|
19
|
-
* @returns
|
|
19
|
+
* @returns Operator that filters to only true-to-false transition emissions.
|
|
20
20
|
*/
|
|
21
21
|
export declare function onTrueToFalse(): MonoTypeOperatorFunction<boolean>;
|
|
22
22
|
/**
|
|
23
23
|
* RxJS operator that only emits when a boolean stream transitions from `false` to `true`.
|
|
24
24
|
*
|
|
25
|
-
* @returns
|
|
25
|
+
* @returns Operator that filters to only false-to-true transition emissions.
|
|
26
26
|
*/
|
|
27
27
|
export declare function onFalseToTrue(): MonoTypeOperatorFunction<boolean>;
|
|
@@ -9,9 +9,9 @@ export type ObservableDecisionFunction<T> = (value: T) => Observable<boolean>;
|
|
|
9
9
|
*
|
|
10
10
|
* When `invert` is false, returns the original function unchanged.
|
|
11
11
|
*
|
|
12
|
-
* @param decisionFn -
|
|
13
|
-
* @param invert -
|
|
14
|
-
* @returns
|
|
12
|
+
* @param decisionFn - The decision function to invert.
|
|
13
|
+
* @param invert - Whether to apply the inversion (defaults to true)
|
|
14
|
+
* @returns The inverted (or original) decision function.
|
|
15
15
|
*/
|
|
16
16
|
export declare function invertObservableDecision<F extends ObservableDecisionFunction<any>>(decisionFn: F, invert?: boolean): F;
|
|
17
17
|
/**
|
|
@@ -20,8 +20,8 @@ export declare function invertObservableDecision<F extends ObservableDecisionFun
|
|
|
20
20
|
* Items where the decision returns true are kept; others are removed. Results are throttled
|
|
21
21
|
* to prevent excessive re-emissions.
|
|
22
22
|
*
|
|
23
|
-
* @param observableDecisionFunction -
|
|
24
|
-
* @param throttle -
|
|
25
|
-
* @returns
|
|
23
|
+
* @param observableDecisionFunction - Async predicate to evaluate each item.
|
|
24
|
+
* @param throttle - Throttle duration in ms (defaults to 20)
|
|
25
|
+
* @returns An operator that async-filters array elements.
|
|
26
26
|
*/
|
|
27
27
|
export declare function filterItemsWithObservableDecision<T>(observableDecisionFunction: ObservableDecisionFunction<T>, throttle?: Milliseconds): MonoTypeOperatorFunction<T[]>;
|
package/src/lib/rxjs/delta.d.ts
CHANGED
|
@@ -6,23 +6,23 @@ export interface OnMatchDeltaConfig<T> {
|
|
|
6
6
|
/**
|
|
7
7
|
* The first from value.
|
|
8
8
|
*/
|
|
9
|
-
from: T;
|
|
9
|
+
readonly from: T;
|
|
10
10
|
/**
|
|
11
11
|
* The target value to receive after the first.
|
|
12
12
|
*/
|
|
13
|
-
to: T;
|
|
13
|
+
readonly to: T;
|
|
14
14
|
/**
|
|
15
15
|
* Comparison function to compare equality between the emission and the target values.
|
|
16
16
|
*
|
|
17
17
|
* isMatch is checked for each value, and at the time a match is found, allowing a double check to occur on the from target value.
|
|
18
18
|
*/
|
|
19
|
-
isMatch?: (a: T, b: T) => boolean;
|
|
19
|
+
readonly isMatch?: (a: T, b: T) => boolean;
|
|
20
20
|
/**
|
|
21
21
|
* Whether or not the two values must be emitted consecutively.
|
|
22
22
|
*
|
|
23
23
|
* For example, if requiredConsecutive=true and we are waiting for 1 -> 2, and the emissions are 1,0,2, the observable function will not emit 2.
|
|
24
24
|
*/
|
|
25
|
-
requireConsecutive?: boolean;
|
|
25
|
+
readonly requireConsecutive?: boolean;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* RxJS operator that emits only when the stream transitions from a `from` value to a `to` value.
|
|
@@ -30,6 +30,9 @@ export interface OnMatchDeltaConfig<T> {
|
|
|
30
30
|
* The `from` value must be seen first; only then is the `to` value emitted. When `requireConsecutive`
|
|
31
31
|
* is true, the two values must be adjacent emissions.
|
|
32
32
|
*
|
|
33
|
+
* @param config - From/to values, optional comparator, and consecutive requirement.
|
|
34
|
+
* @returns An operator that emits on value transitions.
|
|
35
|
+
*
|
|
33
36
|
* @example
|
|
34
37
|
* ```ts
|
|
35
38
|
* // Emit when transitioning from true to false
|
|
@@ -37,8 +40,5 @@ export interface OnMatchDeltaConfig<T> {
|
|
|
37
40
|
* onMatchDelta({ from: true, to: false, requireConsecutive: true })
|
|
38
41
|
* ).subscribe((val) => console.log('Transitioned to false'));
|
|
39
42
|
* ```
|
|
40
|
-
*
|
|
41
|
-
* @param config - from/to values, optional comparator, and consecutive requirement
|
|
42
|
-
* @returns an operator that emits on value transitions
|
|
43
43
|
*/
|
|
44
44
|
export declare function onMatchDelta<T>(config: OnMatchDeltaConfig<T>): MonoTypeOperatorFunction<T>;
|
|
@@ -4,44 +4,44 @@ import { type MonoTypeOperatorFunction, type Observable, type OperatorFunction }
|
|
|
4
4
|
* RxJS operator that maps each emission to a new {@link Expires} object with an expiration
|
|
5
5
|
* time relative to the current moment.
|
|
6
6
|
*
|
|
7
|
-
* @param expiresIn -
|
|
8
|
-
* @returns
|
|
7
|
+
* @param expiresIn - Duration in milliseconds until expiration.
|
|
8
|
+
* @returns An `OperatorFunction` that maps each emission to an {@link Expires} object.
|
|
9
9
|
*/
|
|
10
10
|
export declare function toExpiration<T>(expiresIn: number): OperatorFunction<T, Expires>;
|
|
11
11
|
/**
|
|
12
12
|
* RxJS operator that filters out emissions whose {@link Expires} value has already expired.
|
|
13
13
|
*
|
|
14
|
-
* @returns
|
|
14
|
+
* @returns Operator that only passes through non-expired emissions.
|
|
15
15
|
*/
|
|
16
16
|
export declare function skipExpired<T extends Expires>(): MonoTypeOperatorFunction<T>;
|
|
17
17
|
/**
|
|
18
18
|
* RxJS operator that skips emissions until the elapsed time since the emitted date/timestamp has exceeded `expiresIn`.
|
|
19
19
|
*
|
|
20
|
-
* @param expiresIn -
|
|
21
|
-
* @returns
|
|
20
|
+
* @param expiresIn - Duration in milliseconds.
|
|
21
|
+
* @returns Operator that skips emissions until the time window has elapsed.
|
|
22
22
|
*/
|
|
23
23
|
export declare function skipUntilExpiration(expiresIn?: number): MonoTypeOperatorFunction<DateOrUnixDateTimeMillisecondsNumber>;
|
|
24
24
|
/**
|
|
25
25
|
* RxJS operator that skips emissions after the elapsed time since the emitted date/timestamp has exceeded `expiresIn`.
|
|
26
26
|
*
|
|
27
|
-
* @param expiresIn -
|
|
28
|
-
* @returns
|
|
27
|
+
* @param expiresIn - Duration in milliseconds.
|
|
28
|
+
* @returns Operator that passes through emissions only within the time window.
|
|
29
29
|
*/
|
|
30
30
|
export declare function skipAfterExpiration(expiresIn?: number): MonoTypeOperatorFunction<DateOrUnixDateTimeMillisecondsNumber>;
|
|
31
31
|
/**
|
|
32
32
|
* RxJS operator that only takes emissions from the source within a time window after each emission from a watch observable.
|
|
33
33
|
*
|
|
34
|
-
* @param watch -
|
|
35
|
-
* @param takeFor -
|
|
36
|
-
* @returns
|
|
34
|
+
* @param watch - Observable whose emissions reset the time window.
|
|
35
|
+
* @param takeFor - Duration in milliseconds of each time window.
|
|
36
|
+
* @returns Operator that limits source emissions to the active time window after each watch emission.
|
|
37
37
|
*/
|
|
38
38
|
export declare function skipUntilTimeElapsedAfterLastEmission<T>(watch: Observable<unknown>, takeFor: Milliseconds): MonoTypeOperatorFunction<T>;
|
|
39
39
|
/**
|
|
40
40
|
* RxJS operator that skips emissions from the source for a duration after each emission from a watch observable,
|
|
41
41
|
* then passes values through once the time has elapsed.
|
|
42
42
|
*
|
|
43
|
-
* @param watch -
|
|
44
|
-
* @param skipFor -
|
|
45
|
-
* @returns
|
|
43
|
+
* @param watch - Observable whose emissions reset the skip window.
|
|
44
|
+
* @param skipFor - Duration in milliseconds to skip after each watch emission.
|
|
45
|
+
* @returns An operator that delays passing values through until time has elapsed since the last watch emission.
|
|
46
46
|
*/
|
|
47
47
|
export declare function takeAfterTimeElapsedSinceLastEmission<T>(watch: Observable<unknown>, skipFor: Milliseconds): MonoTypeOperatorFunction<T>;
|
|
@@ -7,19 +7,19 @@ export interface FactoryTimerConfig<T> {
|
|
|
7
7
|
/**
|
|
8
8
|
* How long to wait before the first emission.
|
|
9
9
|
*/
|
|
10
|
-
wait?: number;
|
|
10
|
+
readonly wait?: number;
|
|
11
11
|
/**
|
|
12
12
|
* Interval period
|
|
13
13
|
*/
|
|
14
|
-
interval?: number;
|
|
14
|
+
readonly interval?: number;
|
|
15
15
|
/**
|
|
16
16
|
* Max number of iterations.
|
|
17
17
|
*/
|
|
18
|
-
limit?: number;
|
|
18
|
+
readonly limit?: number;
|
|
19
19
|
/**
|
|
20
20
|
* Factory for values.
|
|
21
21
|
*/
|
|
22
|
-
factory: FactoryWithInput<T, number>;
|
|
22
|
+
readonly factory: FactoryWithInput<T, number>;
|
|
23
23
|
}
|
|
24
24
|
export declare const DEFAULT_FACTORY_TIMER_INTERVAL = 1000;
|
|
25
25
|
/**
|
|
@@ -28,6 +28,9 @@ export declare const DEFAULT_FACTORY_TIMER_INTERVAL = 1000;
|
|
|
28
28
|
* Wraps `timer()` internally and maps each tick index through the factory. Optionally limits
|
|
29
29
|
* the total number of emissions.
|
|
30
30
|
*
|
|
31
|
+
* @param config - Timer configuration including factory, interval, wait, and limit.
|
|
32
|
+
* @returns An observable of factory-produced values.
|
|
33
|
+
*
|
|
31
34
|
* @example
|
|
32
35
|
* ```ts
|
|
33
36
|
* const countdown$ = factoryTimer({
|
|
@@ -37,8 +40,5 @@ export declare const DEFAULT_FACTORY_TIMER_INTERVAL = 1000;
|
|
|
37
40
|
* });
|
|
38
41
|
* // emits 10, 9, 8, ... 0
|
|
39
42
|
* ```
|
|
40
|
-
*
|
|
41
|
-
* @param config - timer configuration including factory, interval, wait, and limit
|
|
42
|
-
* @returns an observable of factory-produced values
|
|
43
43
|
*/
|
|
44
44
|
export declare function factoryTimer<T>(config: FactoryTimerConfig<T>): Observable<T>;
|
package/src/lib/rxjs/getter.d.ts
CHANGED
|
@@ -16,14 +16,14 @@ export declare function asObservable<T>(valueOrObs: Maybe<ObservableOrValue<T>>)
|
|
|
16
16
|
/**
|
|
17
17
|
* RxJS operator that flattens an emitted {@link ObservableOrValue} into its unwrapped value via `switchMap`.
|
|
18
18
|
*
|
|
19
|
-
* @returns
|
|
19
|
+
* @returns An operator that unwraps ObservableOrValue emissions.
|
|
20
20
|
*/
|
|
21
21
|
export declare function valueFromObservableOrValue<T>(): OperatorFunction<ObservableOrValue<T>, T>;
|
|
22
22
|
/**
|
|
23
23
|
* RxJS operator that flattens an emitted Maybe<{@link ObservableOrValue}> into its unwrapped value,
|
|
24
24
|
* emitting `undefined` when the input is nullish.
|
|
25
25
|
*
|
|
26
|
-
* @returns
|
|
26
|
+
* @returns An operator that unwraps Maybe<ObservableOrValue> emissions.
|
|
27
27
|
*/
|
|
28
28
|
export declare function maybeValueFromObservableOrValue<T>(): OperatorFunction<MaybeObservableOrValue<T>, Maybe<T>>;
|
|
29
29
|
/**
|
|
@@ -48,14 +48,14 @@ export declare function asObservableFromGetter<T extends GetterDistinctValue, A>
|
|
|
48
48
|
/**
|
|
49
49
|
* RxJS operator that flattens an emitted {@link ObservableOrValueGetter} into its resolved value via `switchMap`.
|
|
50
50
|
*
|
|
51
|
-
* @returns
|
|
51
|
+
* @returns An operator that unwraps getter emissions.
|
|
52
52
|
*/
|
|
53
53
|
export declare function valueFromObservableOrValueGetter<T>(): OperatorFunction<ObservableOrValueGetter<T>, T>;
|
|
54
54
|
/**
|
|
55
55
|
* RxJS operator that flattens an emitted Maybe<{@link ObservableOrValueGetter}> into its resolved value,
|
|
56
56
|
* emitting `undefined` when the input is nullish.
|
|
57
57
|
*
|
|
58
|
-
* @returns
|
|
58
|
+
* @returns An operator that unwraps Maybe<ObservableOrValueGetter> emissions, emitting undefined for nullish inputs.
|
|
59
59
|
*/
|
|
60
60
|
export declare function maybeValueFromObservableOrValueGetter<T>(): OperatorFunction<MaybeObservableOrValueGetter<T>, Maybe<T>>;
|
|
61
61
|
/**
|
package/src/lib/rxjs/key.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import { type MonoTypeOperatorFunction } from 'rxjs';
|
|
|
4
4
|
* `distinctUntilChanged` variant for arrays that only emits when the set of keys extracted from
|
|
5
5
|
* the array elements changes.
|
|
6
6
|
*
|
|
7
|
-
* @param readKey -
|
|
8
|
-
* @returns
|
|
7
|
+
* @param readKey - Function to extract one or more keys from each element.
|
|
8
|
+
* @returns An operator that filters out arrays with unchanged key sets.
|
|
9
9
|
*/
|
|
10
10
|
export declare function distinctUntilKeysChange<T, K extends PrimativeKey = PrimativeKey>(readKey: ReadKeyFunction<T, K> | ReadMultipleKeysFunction<T, K>): MonoTypeOperatorFunction<T[]>;
|
|
11
11
|
/**
|
|
12
12
|
* `distinctUntilChanged` variant for single objects that only emits when the extracted key changes.
|
|
13
13
|
*
|
|
14
|
-
* @param readKey -
|
|
15
|
-
* @returns
|
|
14
|
+
* @param readKey - Function to extract a key from the emitted object.
|
|
15
|
+
* @returns An operator that filters out emissions with unchanged keys.
|
|
16
16
|
*/
|
|
17
17
|
export declare function distinctUntilObjectKeyChange<T>(readKey: ReadKeyFunction<T>): MonoTypeOperatorFunction<T>;
|
|
@@ -7,9 +7,9 @@ import { type MonoTypeOperatorFunction } from 'rxjs';
|
|
|
7
7
|
* delays emitting the new value until the previous destruction completes.
|
|
8
8
|
* On unsubscription, the last emitted instance is also destroyed.
|
|
9
9
|
*
|
|
10
|
-
* @param destroy -
|
|
11
|
-
* @param wait -
|
|
12
|
-
* @returns
|
|
10
|
+
* @param destroy - Function to clean up each replaced instance.
|
|
11
|
+
* @param wait - Whether to wait for the previous destroy to complete before emitting.
|
|
12
|
+
* @returns An operator that manages instance lifecycle.
|
|
13
13
|
*/
|
|
14
14
|
export declare function cleanup<T>(destroy: (instance: T) => PromiseOrValue<void>, wait?: boolean): MonoTypeOperatorFunction<T>;
|
|
15
15
|
/**
|
|
@@ -18,7 +18,7 @@ export declare function cleanup<T>(destroy: (instance: T) => PromiseOrValue<void
|
|
|
18
18
|
* Accepts both {@link Destroyable} and {@link Maybe}<{@link Destroyable}> values,
|
|
19
19
|
* skipping cleanup for nullish emissions.
|
|
20
20
|
*
|
|
21
|
-
* @param wait -
|
|
22
|
-
* @returns
|
|
21
|
+
* @param wait - Whether to wait for the previous destroy to complete before emitting.
|
|
22
|
+
* @returns An operator that manages Destroyable lifecycle.
|
|
23
23
|
*/
|
|
24
24
|
export declare function cleanupDestroyable<T extends Maybe<Destroyable>>(wait?: boolean): MonoTypeOperatorFunction<T>;
|
|
@@ -4,12 +4,12 @@ import { type OperatorFunction } from 'rxjs';
|
|
|
4
4
|
*
|
|
5
5
|
* Only considers the first emission from the source. The result is shared via `shareReplay(1)`.
|
|
6
6
|
*
|
|
7
|
+
* @returns An operator that tracks whether the first value has been emitted.
|
|
8
|
+
*
|
|
7
9
|
* @example
|
|
8
10
|
* ```ts
|
|
9
11
|
* const loading$ = dataFetch$.pipe(isLoading());
|
|
10
12
|
* // emits true initially, then false once dataFetch$ emits
|
|
11
13
|
* ```
|
|
12
|
-
*
|
|
13
|
-
* @returns an operator that tracks whether the first value has been emitted
|
|
14
14
|
*/
|
|
15
15
|
export declare function isLoading<T>(): OperatorFunction<T, boolean>;
|
package/src/lib/rxjs/map.d.ts
CHANGED
|
@@ -5,13 +5,13 @@ import { type ObservableOrValue } from './getter';
|
|
|
5
5
|
* RxJS operator that extracts values from a keyed object using a keys observable,
|
|
6
6
|
* returning only the values whose keys are present in both.
|
|
7
7
|
*
|
|
8
|
-
* @param keysObs -
|
|
9
|
-
* @returns
|
|
8
|
+
* @param keysObs - Observable (or static value) of keys to intersect with.
|
|
9
|
+
* @returns An operator that maps a keyed object to an array of matching values.
|
|
10
10
|
*/
|
|
11
11
|
export declare function mapKeysIntersectionToArray<T>(keysObs: ObservableOrValue<Iterable<string>>): OperatorFunction<MapKeysIntersectionObject<T>, T[]>;
|
|
12
12
|
/**
|
|
13
13
|
* `distinctUntilChanged` variant for `Map` instances that only emits when the set of map keys changes.
|
|
14
14
|
*
|
|
15
|
-
* @returns
|
|
15
|
+
* @returns An operator that filters out Maps with unchanged key sets.
|
|
16
16
|
*/
|
|
17
17
|
export declare function distinctUntilMapHasDifferentKeys<I extends Map<K, V>, K, V>(): MonoTypeOperatorFunction<I>;
|
package/src/lib/rxjs/misc.d.ts
CHANGED
|
@@ -24,16 +24,17 @@ export declare function tapLog<T = unknown>(messageFunction: (value: T) => unkno
|
|
|
24
24
|
*
|
|
25
25
|
* Useful for simulating network latency or staggering requests.
|
|
26
26
|
*
|
|
27
|
-
* @param maxOrArgs -
|
|
28
|
-
* @returns
|
|
27
|
+
* @param maxOrArgs - Maximum delay in ms, or a full random number config.
|
|
28
|
+
* @returns An operator that delays each emission by a random amount.
|
|
29
29
|
*/
|
|
30
30
|
export declare function randomDelay<T = unknown>(maxOrArgs: number | RandomNumberFactoryConfig): MonoTypeOperatorFunction<T>;
|
|
31
31
|
/**
|
|
32
32
|
* RxJS operator that adds a random delay using a custom random number generator.
|
|
33
33
|
*
|
|
34
|
-
* @param makeRandomDelay -
|
|
35
|
-
* @param scheduler -
|
|
36
|
-
* @returns
|
|
34
|
+
* @param makeRandomDelay - Factory that produces random delay values.
|
|
35
|
+
* @param scheduler - The scheduler to use for the delay (defaults to asyncScheduler)
|
|
36
|
+
* @returns An operator that delays each emission.
|
|
37
|
+
*
|
|
37
38
|
* @__NO_SIDE_EFFECTS__
|
|
38
39
|
*/
|
|
39
40
|
export declare function randomDelayWithRandomFunction<T = unknown>(makeRandomDelay: RandomNumberFactory, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;
|
package/src/lib/rxjs/model.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { type ModelKeyRef, type UniqueModel } from '@dereekb/util';
|
|
|
2
2
|
/**
|
|
3
3
|
* `distinctUntilChanged` variant that only emits when the model's `id` property changes.
|
|
4
4
|
*
|
|
5
|
-
* @returns
|
|
5
|
+
* @returns Operator that suppresses consecutive emissions with the same model `id`
|
|
6
6
|
*/
|
|
7
7
|
export declare function distinctUntilModelIdChange<T extends UniqueModel>(): import("rxjs").MonoTypeOperatorFunction<T>;
|
|
8
8
|
/**
|
|
9
9
|
* `distinctUntilChanged` variant that only emits when the model's `key` property changes.
|
|
10
10
|
*
|
|
11
|
-
* @returns
|
|
11
|
+
* @returns Operator that suppresses consecutive emissions with the same model `key`
|
|
12
12
|
*/
|
|
13
13
|
export declare function distinctUntilModelKeyChange<T extends ModelKeyRef>(): import("rxjs").MonoTypeOperatorFunction<T>;
|
package/src/lib/rxjs/number.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { type FactoryTimerConfig } from './factory';
|
|
|
5
5
|
* RxJS operator that counts emissions as they occur using `scan`, emitting the running count
|
|
6
6
|
* after each emission (unlike `count()` which only emits on completion).
|
|
7
7
|
*
|
|
8
|
-
* @param startAt -
|
|
9
|
-
* @returns
|
|
8
|
+
* @param startAt - Initial count value (defaults to 0)
|
|
9
|
+
* @returns An operator that emits the running emission count.
|
|
10
10
|
*/
|
|
11
11
|
export declare function scanCount(startAt?: number): OperatorFunction<unknown, number>;
|
|
12
12
|
/**
|
|
@@ -17,7 +17,7 @@ export interface IncrementingTimerConfig extends Omit<FactoryTimerConfig<number>
|
|
|
17
17
|
/**
|
|
18
18
|
* Creates a {@link factoryTimer} that emits incrementing numbers on an interval.
|
|
19
19
|
*
|
|
20
|
-
* @param config -
|
|
21
|
-
* @returns
|
|
20
|
+
* @param config - Timer and incrementing number configuration.
|
|
21
|
+
* @returns An observable of incrementing numbers.
|
|
22
22
|
*/
|
|
23
23
|
export declare function incrementingNumberTimer(config?: IncrementingTimerConfig): Observable<number>;
|
|
@@ -45,6 +45,9 @@ export interface AsyncPusherConfig<T> {
|
|
|
45
45
|
* Each call pushes a value onto the internal subject and returns the shared, throttled observable.
|
|
46
46
|
* Useful for debouncing repeated calls while sharing a single observable output.
|
|
47
47
|
*
|
|
48
|
+
* @param config - Optional throttle, distinct, and pipe settings.
|
|
49
|
+
* @returns An async pusher function.
|
|
50
|
+
*
|
|
48
51
|
* @example
|
|
49
52
|
* ```ts
|
|
50
53
|
* const pusher = asyncPusher<string>({ throttle: 100 });
|
|
@@ -54,9 +57,6 @@ export interface AsyncPusherConfig<T> {
|
|
|
54
57
|
* // clean up
|
|
55
58
|
* pusher.destroy();
|
|
56
59
|
* ```
|
|
57
|
-
*
|
|
58
|
-
* @param config - optional throttle, distinct, and pipe settings
|
|
59
|
-
* @returns an async pusher function
|
|
60
60
|
*/
|
|
61
61
|
export declare function asyncPusher<T>(config?: AsyncPusherConfig<T>): AsyncPusher<T>;
|
|
62
62
|
/**
|
|
@@ -68,7 +68,7 @@ export type AsyncPusherCache<T> = CachedFactoryWithInput<AsyncPusher<T>, Observa
|
|
|
68
68
|
*
|
|
69
69
|
* The factory optionally accepts a cleanup observable — when it completes, the pusher is destroyed.
|
|
70
70
|
*
|
|
71
|
-
* @param config -
|
|
72
|
-
* @returns
|
|
71
|
+
* @param config - Optional config passed to the underlying async pusher.
|
|
72
|
+
* @returns A cached factory that produces an async pusher.
|
|
73
73
|
*/
|
|
74
74
|
export declare function asyncPusherCache<T>(config?: AsyncPusherConfig<T>): AsyncPusherCache<T>;
|
package/src/lib/rxjs/rxjs.d.ts
CHANGED
|
@@ -5,18 +5,18 @@ import { type Observable, type MonoTypeOperatorFunction } from 'rxjs';
|
|
|
5
5
|
*
|
|
6
6
|
* Emits the `initial` value first, then taps on the first emitted value to run the provided callback.
|
|
7
7
|
*
|
|
8
|
-
* @param tap -
|
|
9
|
-
* @param initial -
|
|
10
|
-
* @param skipFirst -
|
|
11
|
-
* @returns
|
|
8
|
+
* @param tap - Side-effect function called with the first value.
|
|
9
|
+
* @param initial - Optional starting value emitted before the source.
|
|
10
|
+
* @param skipFirst - If true, skips tapping the initial value.
|
|
11
|
+
* @returns An operator that initializes the pipe with a tap.
|
|
12
12
|
*/
|
|
13
13
|
export declare function initialize<T>(tap: (value: Maybe<T>) => void, initial?: Maybe<T>, skipFirst?: boolean): MonoTypeOperatorFunction<T>;
|
|
14
14
|
/**
|
|
15
15
|
* Executes a side-effect on the first emission from the observable, then passes all values through.
|
|
16
16
|
*
|
|
17
|
-
* @param tap -
|
|
18
|
-
* @param skipFirst -
|
|
19
|
-
* @returns
|
|
17
|
+
* @param tap - The side-effect function to call once.
|
|
18
|
+
* @param skipFirst - If true, skips the very first emission before tapping.
|
|
19
|
+
* @returns An operator that taps the first value.
|
|
20
20
|
*/
|
|
21
21
|
export declare function tapFirst<T>(tap: (value: T) => void, skipFirst?: boolean): MonoTypeOperatorFunction<T>;
|
|
22
22
|
/**
|
|
@@ -25,8 +25,8 @@ export declare function tapFirst<T>(tap: (value: T) => void, skipFirst?: boolean
|
|
|
25
25
|
* The subscription will never have `complete()` called since it only triggers after unsubscription.
|
|
26
26
|
* Use `finalize()` for additional cleanup.
|
|
27
27
|
*
|
|
28
|
-
* @param obs -
|
|
29
|
-
* @returns
|
|
28
|
+
* @param obs - The source observable to wrap.
|
|
29
|
+
* @returns An observable that only completes on unsubscription.
|
|
30
30
|
*/
|
|
31
31
|
export declare function preventComplete<T>(obs: Observable<T>): Observable<T>;
|
|
32
32
|
/**
|
|
@@ -34,13 +34,13 @@ export declare function preventComplete<T>(obs: Observable<T>): Observable<T>;
|
|
|
34
34
|
*
|
|
35
35
|
* Unlike `from()`, the promise/observable is not created until the first subscriber connects.
|
|
36
36
|
*
|
|
37
|
+
* @param getter - Factory that returns a Promise or Observable.
|
|
38
|
+
* @returns A shared observable that defers execution until subscription.
|
|
39
|
+
*
|
|
37
40
|
* @example
|
|
38
41
|
* ```ts
|
|
39
42
|
* const data$ = lazyFrom(() => fetch('/api/data').then(r => r.json()));
|
|
40
43
|
* // The fetch is not called until data$ is subscribed to
|
|
41
44
|
* ```
|
|
42
|
-
*
|
|
43
|
-
* @param getter - factory that returns a Promise or Observable
|
|
44
|
-
* @returns a shared observable that defers execution until subscription
|
|
45
45
|
*/
|
|
46
46
|
export declare function lazyFrom<T>(getter: Getter<Promise<T> | Observable<T>>): Observable<T>;
|
|
@@ -42,6 +42,9 @@ export interface ErrorOnEmissionsInPeriodConfig<T> {
|
|
|
42
42
|
*
|
|
43
43
|
* Useful as a safety valve to detect infinite loops or runaway observables.
|
|
44
44
|
*
|
|
45
|
+
* @param config - Period duration, max emissions, and error/fallback handling.
|
|
46
|
+
* @returns An operator that monitors emission frequency.
|
|
47
|
+
*
|
|
45
48
|
* @example
|
|
46
49
|
* ```ts
|
|
47
50
|
* source$.pipe(
|
|
@@ -49,8 +52,5 @@ export interface ErrorOnEmissionsInPeriodConfig<T> {
|
|
|
49
52
|
* ).subscribe();
|
|
50
53
|
* // throws if more than 100 emissions occur within 1 second
|
|
51
54
|
* ```
|
|
52
|
-
*
|
|
53
|
-
* @param config - period duration, max emissions, and error/fallback handling
|
|
54
|
-
* @returns an operator that monitors emission frequency
|
|
55
55
|
*/
|
|
56
56
|
export declare function errorOnEmissionsInPeriod<T>(config: ErrorOnEmissionsInPeriodConfig<T>): MonoTypeOperatorFunction<T>;
|
|
@@ -4,8 +4,8 @@ import { type PrimativeKey, type ReadKeyFunction, type ReadMultipleKeysFunction
|
|
|
4
4
|
* Creates a function that takes a `Map` and combines the latest emissions from observables
|
|
5
5
|
* created from each map value.
|
|
6
6
|
*
|
|
7
|
-
* @param mapToObs -
|
|
8
|
-
* @returns
|
|
7
|
+
* @param mapToObs - Function to transform each map value into an observable.
|
|
8
|
+
* @returns Operator-ready function that combines the per-entry observables into one emission of results.
|
|
9
9
|
*/
|
|
10
10
|
export declare function combineLatestFromMapValuesObsFn<T, O>(mapToObs: (value: T) => Observable<O>): (map: Map<unknown, T>) => Observable<O[]>;
|
|
11
11
|
/**
|
|
@@ -13,8 +13,8 @@ export declare function combineLatestFromMapValuesObsFn<T, O>(mapToObs: (value:
|
|
|
13
13
|
*
|
|
14
14
|
* Returns `of([])` for empty arrays.
|
|
15
15
|
*
|
|
16
|
-
* @param mapToObs -
|
|
17
|
-
* @returns
|
|
16
|
+
* @param mapToObs - Function to transform each value into an observable.
|
|
17
|
+
* @returns Operator-ready function that combines the latest emissions from each derived observable.
|
|
18
18
|
*/
|
|
19
19
|
export declare function combineLatestFromArrayObsFn<T, O>(mapToObs: (value: T) => Observable<O>): (values: T[]) => Observable<O[]>;
|
|
20
20
|
export type ObservableObjectMap = object;
|
|
@@ -27,6 +27,9 @@ export type ObservableObjectMapResult<T extends ObservableObjectMap> = {
|
|
|
27
27
|
* Each key in the input object maps to an observable (or static value). The result observable
|
|
28
28
|
* emits an object with the same keys, where each value is the latest emission from its source.
|
|
29
29
|
*
|
|
30
|
+
* @param objectMap - An object whose values are observables or static values.
|
|
31
|
+
* @returns An observable that emits the resolved object.
|
|
32
|
+
*
|
|
30
33
|
* @example
|
|
31
34
|
* ```ts
|
|
32
35
|
* const result$ = combineLatestFromObject({
|
|
@@ -35,23 +38,20 @@ export type ObservableObjectMapResult<T extends ObservableObjectMap> = {
|
|
|
35
38
|
* });
|
|
36
39
|
* // emits { name: 'Alice', age: 30 }
|
|
37
40
|
* ```
|
|
38
|
-
*
|
|
39
|
-
* @param objectMap - an object whose values are observables or static values
|
|
40
|
-
* @returns an observable that emits the resolved object
|
|
41
41
|
*/
|
|
42
42
|
export declare function combineLatestFromObject<T extends ObservableObjectMap>(objectMap: T): Observable<ObservableObjectMapResult<T>>;
|
|
43
43
|
/**
|
|
44
44
|
* RxJS operator that maps an array of items to a `Map<K, T>` using the provided key reader.
|
|
45
45
|
*
|
|
46
|
-
* @param read -
|
|
47
|
-
* @returns
|
|
46
|
+
* @param read - Function to extract the key from each item.
|
|
47
|
+
* @returns An operator that converts an array into a keyed Map.
|
|
48
48
|
*/
|
|
49
49
|
export declare function keyValueMap<T, K extends PrimativeKey = PrimativeKey>(read: ReadKeyFunction<T, K>): OperatorFunction<T[], Map<K, T>>;
|
|
50
50
|
/**
|
|
51
51
|
* RxJS operator that maps an array of items to a `Map<K, T>` using a multi-key reader,
|
|
52
52
|
* allowing each item to appear under multiple keys.
|
|
53
53
|
*
|
|
54
|
-
* @param read -
|
|
55
|
-
* @returns
|
|
54
|
+
* @param read - Function to extract multiple keys from each item.
|
|
55
|
+
* @returns An operator that converts an array into a multi-keyed Map.
|
|
56
56
|
*/
|
|
57
57
|
export declare function multiKeyValueMap<T, K extends PrimativeKey = PrimativeKey>(read: ReadMultipleKeysFunction<T, K>): OperatorFunction<T[], Map<K, T>>;
|
|
@@ -5,8 +5,8 @@ import { type MonoTypeOperatorFunction } from 'rxjs';
|
|
|
5
5
|
*
|
|
6
6
|
* Uses {@link filterUniqueFunction} to deduplicate emitted arrays by extracting a key from each item.
|
|
7
7
|
*
|
|
8
|
-
* @param readKey -
|
|
9
|
-
* @param additionalKeysInput -
|
|
10
|
-
* @returns
|
|
8
|
+
* @param readKey - Function to extract the unique key from each item.
|
|
9
|
+
* @param additionalKeysInput - Optional additional keys to include in the unique set.
|
|
10
|
+
* @returns An operator that emits deduplicated arrays.
|
|
11
11
|
*/
|
|
12
12
|
export declare function filterUnique<T, K extends PrimativeKey = PrimativeKey>(readKey: ReadKeyFunction<T, K>, additionalKeysInput?: FilterUniqueFunctionAdditionalKeysInput<T, K>): MonoTypeOperatorFunction<T[]>;
|