@dereekb/rxjs 12.6.21 → 13.0.0
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/LICENSE +1 -1
- package/index.cjs.js +93 -1907
- package/index.esm.js +174 -1974
- package/package.json +5 -5
- package/src/lib/filter/filter.source.d.ts +0 -4
- package/src/lib/iterator/iteration.mapped.page.d.ts +0 -4
- package/src/lib/loading/loading.context.state.d.ts +0 -6
- package/src/lib/loading/loading.state.d.ts +0 -64
- package/src/lib/loading/loading.state.list.d.ts +0 -8
- package/src/lib/lock.d.ts +13 -10
- package/src/lib/rxjs/expires.d.ts +29 -0
- package/src/lib/rxjs/index.d.ts +1 -0
- package/src/lib/rxjs/value.d.ts +0 -10
- package/index.esm.d.ts +0 -1
- /package/{index.cjs.d.ts → index.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/rxjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"default": "./index.cjs.js"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
-
"dependencies": {},
|
|
18
17
|
"peerDependencies": {
|
|
19
|
-
"rxjs": "^7.
|
|
20
|
-
"
|
|
18
|
+
"rxjs": "^7.8.0",
|
|
19
|
+
"core-js": "^3.0.0",
|
|
20
|
+
"@dereekb/util": "13.0.0"
|
|
21
21
|
},
|
|
22
22
|
"module": "./index.esm.js",
|
|
23
23
|
"main": "./index.cjs.js",
|
|
24
|
-
"types": "./index.
|
|
24
|
+
"types": "./index.d.ts"
|
|
25
25
|
}
|
|
@@ -36,8 +36,4 @@ export declare class FilterSourceInstance<F> implements FilterSource<F>, Destroy
|
|
|
36
36
|
setInitialFilterTakesPriority(initialFilterTakesPriority: boolean): void;
|
|
37
37
|
protected initFilterTakesPriority(): void;
|
|
38
38
|
destroy(): void;
|
|
39
|
-
/**
|
|
40
|
-
* @deprecated use setInitialFilterTakesPriority instead.
|
|
41
|
-
*/
|
|
42
|
-
set initialFilterTakesPriority(initialFilterTakesPriority: boolean);
|
|
43
39
|
}
|
|
@@ -18,7 +18,3 @@ export interface MappedPageItemIterationInstance<O, I = unknown, M extends PageL
|
|
|
18
18
|
* @returns
|
|
19
19
|
*/
|
|
20
20
|
export declare function mappedPageItemIteration<O, I = unknown, M extends PageLoadingState<O> = PageLoadingState<O>, L extends PageLoadingState<I> = PageLoadingState<I>, N extends PageItemIteration<I, L> = PageItemIteration<I, L>>(itemIteration: N, config: MappedItemIterationInstanceMapConfig<O, I, M, L>): MappedPageItemIterationInstance<O, I, M, L, N>;
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated use mappedPageItemIteration instead.
|
|
23
|
-
*/
|
|
24
|
-
export declare const mapPageItemIteration: typeof mappedPageItemIteration;
|
|
@@ -72,12 +72,6 @@ export interface LoadingStateContextConfig<T = unknown, S extends LoadingState<T
|
|
|
72
72
|
* @returns the event to emit
|
|
73
73
|
*/
|
|
74
74
|
readonly loadingEventForLoadingPair?: Maybe<(state: S, config: LoadingEventForLoadingPairConfigInput) => E>;
|
|
75
|
-
/**
|
|
76
|
-
* Alias for showLoadingOnUndefinedValue.
|
|
77
|
-
*
|
|
78
|
-
* @deprecated Use showLoadingOnUndefinedValue instead.
|
|
79
|
-
*/
|
|
80
|
-
readonly showLoadingOnNoValue?: Maybe<boolean>;
|
|
81
75
|
}
|
|
82
76
|
export type LoadingEventForLoadingPairConfigInput = Pick<LoadingStateContextConfig, 'showLoadingOnUndefinedValue'>;
|
|
83
77
|
export declare const DEFAULT_LOADING_EVENT_FOR_LOADING_PAIR_FUNCTION: <T = unknown, S extends LoadingState<T> = LoadingState<T>, E extends LoadingStateContextEvent = LoadingContextEvent & S>(state: S, input: LoadingEventForLoadingPairConfigInput) => LoadingStateContextEvent<T>;
|
|
@@ -265,67 +265,3 @@ export declare function mapLoadingStateResults<A, B, L extends Partial<PageLoadi
|
|
|
265
265
|
export type MapLoadingStateValueFunction<O, I, L extends LoadingState<I> = LoadingState<I>> = MapFunction<L, Maybe<O>>;
|
|
266
266
|
export type MapLoadingStateValueMapFunction<O, I, L extends LoadingState<I> = LoadingState<I>> = (item: I, state: L) => Maybe<O>;
|
|
267
267
|
export declare function mapLoadingStateValueFunction<O, I, L extends LoadingState<I> = LoadingState<I>>(mapFn: MapLoadingStateValueMapFunction<O, I, L>): MapLoadingStateValueFunction<O, I, L>;
|
|
268
|
-
/**
|
|
269
|
-
* @deprecated use unknownLoadingStatesIsLoading instead.
|
|
270
|
-
*/
|
|
271
|
-
export declare const unknownLoadingStatesIsLoading: typeof isAnyLoadingStateInLoadingState;
|
|
272
|
-
/**
|
|
273
|
-
* @deprecated use areAllLoadingStatesFinishedLoading instead.
|
|
274
|
-
*/
|
|
275
|
-
export declare const allLoadingStatesHaveFinishedLoading: typeof areAllLoadingStatesFinishedLoading;
|
|
276
|
-
/**
|
|
277
|
-
* @deprecated use isLoadingStateInIdleState instead.
|
|
278
|
-
*/
|
|
279
|
-
export declare const loadingStateIsIdle: <L extends LoadingState>(state: Maybe<L>) => boolean;
|
|
280
|
-
/**
|
|
281
|
-
* @deprecated use isLoadingStateInSuccessState instead.
|
|
282
|
-
*/
|
|
283
|
-
export declare const isSuccessLoadingState: <L extends LoadingState>(state: Maybe<L>) => boolean;
|
|
284
|
-
/**
|
|
285
|
-
* @deprecated use isLoadingStateInErrorState instead.
|
|
286
|
-
*/
|
|
287
|
-
export declare const isErrorLoadingState: <L extends LoadingState>(state: Maybe<L>) => boolean;
|
|
288
|
-
/**
|
|
289
|
-
* @deprecated Use isLoadingStateLoading instead.
|
|
290
|
-
*/
|
|
291
|
-
export declare const loadingStateIsLoading: <L extends LoadingState>(state: Maybe<L>) => boolean;
|
|
292
|
-
/**
|
|
293
|
-
* @deprecated use isLoadingStateFinishedLoading instead.
|
|
294
|
-
*/
|
|
295
|
-
export declare const loadingStateHasFinishedLoading: typeof isLoadingStateFinishedLoading;
|
|
296
|
-
/**
|
|
297
|
-
* @deprecated use isLoadingStateWithError instead.
|
|
298
|
-
*/
|
|
299
|
-
export declare const loadingStateHasError: typeof isLoadingStateWithError;
|
|
300
|
-
/**
|
|
301
|
-
* @deprecated use isLoadingStateWithDefinedValue instead.
|
|
302
|
-
*/
|
|
303
|
-
export declare const loadingStateHasValue: typeof isLoadingStateWithDefinedValue;
|
|
304
|
-
/**
|
|
305
|
-
* @deprecated use isLoadingStateFinishedLoadingWithDefinedValue instead.
|
|
306
|
-
*/
|
|
307
|
-
export declare const loadingStateHasFinishedLoadingWithValue: typeof isLoadingStateFinishedLoadingWithDefinedValue;
|
|
308
|
-
/**
|
|
309
|
-
* @deprecated use isLoadingStateFinishedLoadingWithError instead.
|
|
310
|
-
*/
|
|
311
|
-
export declare const loadingStateHasFinishedLoadingWithError: typeof isLoadingStateFinishedLoadingWithError;
|
|
312
|
-
/**
|
|
313
|
-
* @deprecated use isPageLoadingStateMetadataEqual instead.
|
|
314
|
-
*/
|
|
315
|
-
export declare const loadingStatesHaveEquivalentMetadata: typeof isPageLoadingStateMetadataEqual;
|
|
316
|
-
/**
|
|
317
|
-
* @deprecated use LoadingStateWithDefinedValue instead.
|
|
318
|
-
*/
|
|
319
|
-
export type LoadingStateWithMaybeSoValue = LoadingStateWithDefinedValue;
|
|
320
|
-
/**
|
|
321
|
-
* @deprecated use mergeLoadingStateWithLoading instead.
|
|
322
|
-
*/
|
|
323
|
-
export declare const updatedStateForSetLoading: typeof mergeLoadingStateWithLoading;
|
|
324
|
-
/**
|
|
325
|
-
* @deprecated use updatedStateForSetValue instead.
|
|
326
|
-
*/
|
|
327
|
-
export declare const updatedStateForSetValue: typeof mergeLoadingStateWithValue;
|
|
328
|
-
/**
|
|
329
|
-
* @deprecated use mergeLoadingStateWithError instead.
|
|
330
|
-
*/
|
|
331
|
-
export declare const updatedStateForSetError: typeof mergeLoadingStateWithError;
|
|
@@ -26,11 +26,3 @@ export declare function pageLoadingStateFromObs<T>(obs: Observable<T>, firstOnly
|
|
|
26
26
|
* @returns Observable of the value
|
|
27
27
|
*/
|
|
28
28
|
export declare function arrayValueFromFinishedLoadingState<L extends ListLoadingState>(): OperatorFunction<L, LoadingStateValue<L>>;
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated use isListLoadingStateWithEmptyValue instead.
|
|
31
|
-
*/
|
|
32
|
-
export declare const listLoadingStateIsEmpty: typeof isListLoadingStateWithEmptyValue;
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated use mapIsListLoadingStateWithEmptyValue instead.
|
|
35
|
-
*/
|
|
36
|
-
export declare const isListLoadingStateEmpty: typeof mapIsListLoadingStateWithEmptyValue;
|
package/src/lib/lock.d.ts
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { type ObservableOrValue } from './rxjs/getter';
|
|
2
|
-
import { type
|
|
2
|
+
import { type Subscription, type Observable } from 'rxjs';
|
|
3
3
|
import { type Destroyable, type Maybe } from '@dereekb/util';
|
|
4
4
|
export type LockKey = string;
|
|
5
5
|
export type OnLockSetUnlockedFunction = (unlocked: boolean) => void;
|
|
6
6
|
export type RemoveLockFunction = () => void;
|
|
7
7
|
export interface OnLockSetUnlockedConfig {
|
|
8
|
-
lockSet: LockSet;
|
|
9
|
-
fn
|
|
10
|
-
timeout?: Maybe<number>;
|
|
11
|
-
delayTime?: Maybe<number>;
|
|
8
|
+
readonly lockSet: LockSet;
|
|
9
|
+
readonly fn?: Maybe<OnLockSetUnlockedFunction>;
|
|
10
|
+
readonly timeout?: Maybe<number>;
|
|
11
|
+
readonly delayTime?: Maybe<number>;
|
|
12
12
|
}
|
|
13
|
+
export type DestroyOnNextUnlockConfig = Omit<OnLockSetUnlockedConfig, 'lockSet'>;
|
|
13
14
|
export interface SetLockedConfig {
|
|
14
15
|
/**
|
|
15
16
|
* Whether or not to lock the config.
|
|
16
17
|
*/
|
|
17
|
-
locked?: boolean;
|
|
18
|
+
readonly locked?: boolean;
|
|
18
19
|
/**
|
|
19
20
|
* Optional duration to set the locked state.
|
|
20
21
|
*
|
|
21
22
|
* Only relevant for locking.
|
|
22
23
|
*/
|
|
23
|
-
duration?: number;
|
|
24
|
+
readonly duration?: number;
|
|
24
25
|
}
|
|
25
26
|
export declare const DEFAULT_LOCK_SET_TIME_LOCK_KEY = "timelock";
|
|
26
27
|
/**
|
|
@@ -34,14 +35,16 @@ export declare function onLockSetNextUnlock({ lockSet, fn, timeout: inputTimeout
|
|
|
34
35
|
*/
|
|
35
36
|
export declare class LockSet implements Destroyable {
|
|
36
37
|
private static LOCK_SET_CHILD_INDEX_STEPPER;
|
|
37
|
-
private
|
|
38
|
-
private
|
|
38
|
+
private readonly _onDestroy;
|
|
39
|
+
private readonly _locks;
|
|
40
|
+
private readonly _parentSub;
|
|
39
41
|
readonly locks$: Observable<Map<string, Observable<boolean>>>;
|
|
40
42
|
/**
|
|
41
43
|
* isLocked$ is true if any observable is emitting true.
|
|
42
44
|
*/
|
|
43
45
|
readonly isLocked$: Observable<boolean>;
|
|
44
46
|
readonly isUnlocked$: Observable<boolean>;
|
|
47
|
+
readonly onDestroy$: Observable<void>;
|
|
45
48
|
private get locks();
|
|
46
49
|
setLocked(key: LockKey, config: SetLockedConfig): void;
|
|
47
50
|
setLocked(key: LockKey, config: boolean, duration?: number): void;
|
|
@@ -56,6 +59,6 @@ export declare class LockSet implements Destroyable {
|
|
|
56
59
|
* Convenience function for watching a child lockset's locked state and propogating it upward.
|
|
57
60
|
*/
|
|
58
61
|
addChildLockSet(lockSet: LockSet, key?: LockKey): RemoveLockFunction;
|
|
59
|
-
destroyOnNextUnlock(config?:
|
|
62
|
+
destroyOnNextUnlock(config?: Maybe<DestroyOnNextUnlockConfig['fn'] | DestroyOnNextUnlockConfig>, delayTime?: number): void;
|
|
60
63
|
destroy(): void;
|
|
61
64
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type Milliseconds, type DateOrUnixDateTimeMillisecondsNumber, type Expires } from '@dereekb/util';
|
|
2
|
+
import { type MonoTypeOperatorFunction, type Observable, type OperatorFunction } from 'rxjs';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new Expires object at the current time on emission that will expire in the set amount of time.
|
|
5
|
+
*
|
|
6
|
+
* @param expiresIn
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare function toExpiration<T>(expiresIn: number): OperatorFunction<T, Expires>;
|
|
10
|
+
/**
|
|
11
|
+
* Filters further emissions once the input is expired.
|
|
12
|
+
*/
|
|
13
|
+
export declare function skipExpired<T extends Expires>(): MonoTypeOperatorFunction<T>;
|
|
14
|
+
/**
|
|
15
|
+
* Skips the input date or timenumber until expiration occurs.
|
|
16
|
+
*/
|
|
17
|
+
export declare function skipUntilExpiration(expiresIn?: number): MonoTypeOperatorFunction<DateOrUnixDateTimeMillisecondsNumber>;
|
|
18
|
+
/**
|
|
19
|
+
* Skips the input date or timenumber after expiration occurs.
|
|
20
|
+
*/
|
|
21
|
+
export declare function skipAfterExpiration(expiresIn?: number): MonoTypeOperatorFunction<DateOrUnixDateTimeMillisecondsNumber>;
|
|
22
|
+
/**
|
|
23
|
+
* Skips emissions until time since the last emission from the watch observable has elapsed.
|
|
24
|
+
*/
|
|
25
|
+
export declare function skipUntilTimeElapsedAfterLastEmission<T>(watch: Observable<unknown>, takeFor: Milliseconds): MonoTypeOperatorFunction<T>;
|
|
26
|
+
/**
|
|
27
|
+
* Takes emissions until time since the last emission from the watch observable has elapsed.
|
|
28
|
+
*/
|
|
29
|
+
export declare function takeAfterTimeElapsedSinceLastEmission<T>(watch: Observable<unknown>, skipFor: Milliseconds): MonoTypeOperatorFunction<T>;
|
package/src/lib/rxjs/index.d.ts
CHANGED
package/src/lib/rxjs/value.d.ts
CHANGED
|
@@ -177,13 +177,3 @@ export declare function emitDelayObs<T>(startWith: T, endWith: T, delayTime: May
|
|
|
177
177
|
* Emits a value after a given delay after every new emission.
|
|
178
178
|
*/
|
|
179
179
|
export declare function emitAfterDelay<T>(value: T, delayTime: number): MonoTypeOperatorFunction<T>;
|
|
180
|
-
/**
|
|
181
|
-
* @deprecated use switchMapFilterMaybe instead.
|
|
182
|
-
*/
|
|
183
|
-
export declare const switchMapMaybeObs: typeof switchMapFilterMaybe;
|
|
184
|
-
/**
|
|
185
|
-
* Skips all initial maybe values, and then returns all values after the first non-null/undefined value is returned.
|
|
186
|
-
*
|
|
187
|
-
* @deprecated use skipAllInitialMaybe instead.
|
|
188
|
-
*/
|
|
189
|
-
export declare const skipFirstMaybe: typeof skipAllInitialMaybe;
|
package/index.esm.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./src/index";
|
|
File without changes
|