@dereekb/rxjs 13.7.0 → 13.8.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/index.cjs.js +25 -64
- package/index.esm.js +25 -64
- package/package.json +2 -2
package/index.cjs.js
CHANGED
|
@@ -581,11 +581,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
581
581
|
}
|
|
582
582
|
|
|
583
583
|
function asObservable(valueOrObs) {
|
|
584
|
-
|
|
585
|
-
return valueOrObs;
|
|
586
|
-
} else {
|
|
587
|
-
return rxjs.of(valueOrObs);
|
|
588
|
-
}
|
|
584
|
+
return rxjs.isObservable(valueOrObs) ? valueOrObs : rxjs.of(valueOrObs);
|
|
589
585
|
}
|
|
590
586
|
/**
|
|
591
587
|
* RxJS operator that flattens an emitted {@link ObservableOrValue} into its unwrapped value via `switchMap`.
|
|
@@ -813,11 +809,7 @@ function _unsupported_iterable_to_array$b(o, minLen) {
|
|
|
813
809
|
*/ function switchMapMaybeDefault() {
|
|
814
810
|
var defaultValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : undefined;
|
|
815
811
|
return rxjs.switchMap(function(x) {
|
|
816
|
-
|
|
817
|
-
return x;
|
|
818
|
-
} else {
|
|
819
|
-
return rxjs.of(defaultValue);
|
|
820
|
-
}
|
|
812
|
+
return x != null ? x : rxjs.of(defaultValue);
|
|
821
813
|
});
|
|
822
814
|
}
|
|
823
815
|
function switchMapToDefault(defaultObs, useDefault) {
|
|
@@ -826,11 +818,7 @@ function switchMapToDefault(defaultObs, useDefault) {
|
|
|
826
818
|
};
|
|
827
819
|
return rxjs.switchMap(function(x) {
|
|
828
820
|
return useDefaultFn(x).pipe(rxjs.switchMap(function(useDefault) {
|
|
829
|
-
|
|
830
|
-
return asObservableFromGetter(defaultObs);
|
|
831
|
-
} else {
|
|
832
|
-
return rxjs.of(x);
|
|
833
|
-
}
|
|
821
|
+
return useDefault ? asObservableFromGetter(defaultObs) : rxjs.of(x);
|
|
834
822
|
}));
|
|
835
823
|
});
|
|
836
824
|
}
|
|
@@ -863,11 +851,7 @@ function switchMapWhileFalse(obs, otherwise) {
|
|
|
863
851
|
}
|
|
864
852
|
function switchMapOnBoolean(switchOnValue, obs, otherwise) {
|
|
865
853
|
return rxjs.switchMap(function(x) {
|
|
866
|
-
|
|
867
|
-
return asObservableFromGetter(obs);
|
|
868
|
-
} else {
|
|
869
|
-
return otherwise != null ? asObservableFromGetter(otherwise) : rxjs.EMPTY;
|
|
870
|
-
}
|
|
854
|
+
return x === switchOnValue ? asObservableFromGetter(obs) : otherwise != null ? asObservableFromGetter(otherwise) : rxjs.EMPTY;
|
|
871
855
|
});
|
|
872
856
|
}
|
|
873
857
|
/**
|
|
@@ -1434,9 +1418,8 @@ function _unsupported_iterable_to_array$9(o, minLen) {
|
|
|
1434
1418
|
return true;
|
|
1435
1419
|
}), rxjs.skip(1) // skip the first emission
|
|
1436
1420
|
);
|
|
1437
|
-
} else {
|
|
1438
|
-
return rxjs.EMPTY;
|
|
1439
1421
|
}
|
|
1422
|
+
return rxjs.EMPTY;
|
|
1440
1423
|
}), rxjs.defaultIfEmpty(false)).subscribe(function(clear) {
|
|
1441
1424
|
if (clear) {
|
|
1442
1425
|
_this.resetFilter();
|
|
@@ -1809,9 +1792,8 @@ var FilterMapItem = /*#__PURE__*/ function() {
|
|
|
1809
1792
|
var result = fn(filter);
|
|
1810
1793
|
delete result.preset;
|
|
1811
1794
|
return result;
|
|
1812
|
-
} else {
|
|
1813
|
-
return filter;
|
|
1814
1795
|
}
|
|
1796
|
+
return filter;
|
|
1815
1797
|
};
|
|
1816
1798
|
}
|
|
1817
1799
|
/**
|
|
@@ -2047,11 +2029,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
2047
2029
|
* @returns observable that emits `true` when more items can be loaded
|
|
2048
2030
|
*/ function iterationHasNextAndCanLoadMore(iteration) {
|
|
2049
2031
|
return iteration.canLoadMore$.pipe(rxjs.switchMap(function(canLoadMore) {
|
|
2050
|
-
|
|
2051
|
-
return iteration.hasNext$;
|
|
2052
|
-
} else {
|
|
2053
|
-
return rxjs.of(false);
|
|
2054
|
-
}
|
|
2032
|
+
return canLoadMore ? iteration.hasNext$ : rxjs.of(false);
|
|
2055
2033
|
}), rxjs.shareReplay(1));
|
|
2056
2034
|
}
|
|
2057
2035
|
/**
|
|
@@ -2237,9 +2215,8 @@ function scanIntoArray() {
|
|
|
2237
2215
|
result = result.pipe(rxjs.first());
|
|
2238
2216
|
}
|
|
2239
2217
|
return result;
|
|
2240
|
-
} else {
|
|
2241
|
-
return rxjs.of([]);
|
|
2242
2218
|
}
|
|
2219
|
+
return rxjs.of([]);
|
|
2243
2220
|
});
|
|
2244
2221
|
}
|
|
2245
2222
|
|
|
@@ -2365,16 +2342,12 @@ function scanIntoArray() {
|
|
|
2365
2342
|
* @returns the inverted (or original) decision function
|
|
2366
2343
|
*/ function invertObservableDecision(decisionFn) {
|
|
2367
2344
|
var invert = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
return
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
};
|
|
2375
|
-
} else {
|
|
2376
|
-
return decisionFn;
|
|
2377
|
-
}
|
|
2345
|
+
return invert ? function(value) {
|
|
2346
|
+
var obs = decisionFn(value);
|
|
2347
|
+
return obs.pipe(rxjs.map(function(x) {
|
|
2348
|
+
return !x;
|
|
2349
|
+
}));
|
|
2350
|
+
} : decisionFn;
|
|
2378
2351
|
}
|
|
2379
2352
|
/**
|
|
2380
2353
|
* RxJS operator that filters an emitted array by evaluating each item through an async {@link ObservableDecisionFunction}.
|
|
@@ -3216,20 +3189,14 @@ function _unsupported_iterable_to_array$5(o, minLen) {
|
|
|
3216
3189
|
var error = errorFactory();
|
|
3217
3190
|
onError === null || onError === void 0 ? void 0 : onError(error);
|
|
3218
3191
|
throw error;
|
|
3219
|
-
} else {
|
|
3220
|
-
return x;
|
|
3221
|
-
}
|
|
3222
|
-
}));
|
|
3223
|
-
} else {
|
|
3224
|
-
// switchToObs was provided.
|
|
3225
|
-
return source.pipe(rxjs.switchMap(function(x) {
|
|
3226
|
-
if (counter() > maxEmissionsPerPeriod) {
|
|
3227
|
-
return switchToObs;
|
|
3228
|
-
} else {
|
|
3229
|
-
return rxjs.of(x);
|
|
3230
3192
|
}
|
|
3193
|
+
return x;
|
|
3231
3194
|
}));
|
|
3232
3195
|
}
|
|
3196
|
+
// switchToObs was provided.
|
|
3197
|
+
return source.pipe(rxjs.switchMap(function(x) {
|
|
3198
|
+
return counter() > maxEmissionsPerPeriod ? switchToObs : rxjs.of(x);
|
|
3199
|
+
}));
|
|
3233
3200
|
};
|
|
3234
3201
|
}
|
|
3235
3202
|
|
|
@@ -3314,11 +3281,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
|
|
|
3314
3281
|
var filterFactory = util.searchStringFilterFunction(filter);
|
|
3315
3282
|
return rxjs.switchMap(function(values) {
|
|
3316
3283
|
return search$.pipe(rxjs.map(function(search) {
|
|
3317
|
-
|
|
3318
|
-
return filterFactory(search, values);
|
|
3319
|
-
} else {
|
|
3320
|
-
return values;
|
|
3321
|
-
}
|
|
3284
|
+
return search != null ? filterFactory(search, values) : values;
|
|
3322
3285
|
}));
|
|
3323
3286
|
});
|
|
3324
3287
|
}
|
|
@@ -5794,14 +5757,12 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
5794
5757
|
error: result.error,
|
|
5795
5758
|
value: result
|
|
5796
5759
|
};
|
|
5797
|
-
} else {
|
|
5798
|
-
return successPageResult(nextPageNumber, result);
|
|
5799
5760
|
}
|
|
5761
|
+
return successPageResult(nextPageNumber, result);
|
|
5800
5762
|
}), startWithBeginLoading(page), rxjs.shareReplay(1));
|
|
5801
5763
|
return stateObs;
|
|
5802
|
-
} else {
|
|
5803
|
-
return rxjs.of(prevResult).pipe();
|
|
5804
5764
|
}
|
|
5765
|
+
return rxjs.of(prevResult).pipe();
|
|
5805
5766
|
}), rxjs.map(function(inputState) {
|
|
5806
5767
|
var state;
|
|
5807
5768
|
if (inputState != null) {
|
|
@@ -6045,11 +6006,11 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
6045
6006
|
*/ function isItemPageIteratorResultEndResult(result) {
|
|
6046
6007
|
if (result.error != null) {
|
|
6047
6008
|
return false;
|
|
6048
|
-
}
|
|
6009
|
+
}
|
|
6010
|
+
if (result.end != null) {
|
|
6049
6011
|
return result.end;
|
|
6050
|
-
} else {
|
|
6051
|
-
return !util.hasValueOrNotEmpty(result);
|
|
6052
6012
|
}
|
|
6013
|
+
return !util.hasValueOrNotEmpty(result);
|
|
6053
6014
|
}
|
|
6054
6015
|
function itemPageIteratorShouldLoadNextPage(request, hasNextAndCanLoadMore, prevResult) {
|
|
6055
6016
|
return hasNextAndCanLoadMore && // Must be able to load more
|
package/index.esm.js
CHANGED
|
@@ -579,11 +579,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
579
579
|
}
|
|
580
580
|
|
|
581
581
|
function asObservable(valueOrObs) {
|
|
582
|
-
|
|
583
|
-
return valueOrObs;
|
|
584
|
-
} else {
|
|
585
|
-
return of(valueOrObs);
|
|
586
|
-
}
|
|
582
|
+
return isObservable(valueOrObs) ? valueOrObs : of(valueOrObs);
|
|
587
583
|
}
|
|
588
584
|
/**
|
|
589
585
|
* RxJS operator that flattens an emitted {@link ObservableOrValue} into its unwrapped value via `switchMap`.
|
|
@@ -811,11 +807,7 @@ function _unsupported_iterable_to_array$b(o, minLen) {
|
|
|
811
807
|
*/ function switchMapMaybeDefault() {
|
|
812
808
|
var defaultValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : undefined;
|
|
813
809
|
return switchMap(function(x) {
|
|
814
|
-
|
|
815
|
-
return x;
|
|
816
|
-
} else {
|
|
817
|
-
return of(defaultValue);
|
|
818
|
-
}
|
|
810
|
+
return x != null ? x : of(defaultValue);
|
|
819
811
|
});
|
|
820
812
|
}
|
|
821
813
|
function switchMapToDefault(defaultObs, useDefault) {
|
|
@@ -824,11 +816,7 @@ function switchMapToDefault(defaultObs, useDefault) {
|
|
|
824
816
|
};
|
|
825
817
|
return switchMap(function(x) {
|
|
826
818
|
return useDefaultFn(x).pipe(switchMap(function(useDefault) {
|
|
827
|
-
|
|
828
|
-
return asObservableFromGetter(defaultObs);
|
|
829
|
-
} else {
|
|
830
|
-
return of(x);
|
|
831
|
-
}
|
|
819
|
+
return useDefault ? asObservableFromGetter(defaultObs) : of(x);
|
|
832
820
|
}));
|
|
833
821
|
});
|
|
834
822
|
}
|
|
@@ -861,11 +849,7 @@ function switchMapWhileFalse(obs, otherwise) {
|
|
|
861
849
|
}
|
|
862
850
|
function switchMapOnBoolean(switchOnValue, obs, otherwise) {
|
|
863
851
|
return switchMap(function(x) {
|
|
864
|
-
|
|
865
|
-
return asObservableFromGetter(obs);
|
|
866
|
-
} else {
|
|
867
|
-
return otherwise != null ? asObservableFromGetter(otherwise) : EMPTY;
|
|
868
|
-
}
|
|
852
|
+
return x === switchOnValue ? asObservableFromGetter(obs) : otherwise != null ? asObservableFromGetter(otherwise) : EMPTY;
|
|
869
853
|
});
|
|
870
854
|
}
|
|
871
855
|
/**
|
|
@@ -1432,9 +1416,8 @@ function _unsupported_iterable_to_array$9(o, minLen) {
|
|
|
1432
1416
|
return true;
|
|
1433
1417
|
}), skip(1) // skip the first emission
|
|
1434
1418
|
);
|
|
1435
|
-
} else {
|
|
1436
|
-
return EMPTY;
|
|
1437
1419
|
}
|
|
1420
|
+
return EMPTY;
|
|
1438
1421
|
}), defaultIfEmpty(false)).subscribe(function(clear) {
|
|
1439
1422
|
if (clear) {
|
|
1440
1423
|
_this.resetFilter();
|
|
@@ -1807,9 +1790,8 @@ var FilterMapItem = /*#__PURE__*/ function() {
|
|
|
1807
1790
|
var result = fn(filter);
|
|
1808
1791
|
delete result.preset;
|
|
1809
1792
|
return result;
|
|
1810
|
-
} else {
|
|
1811
|
-
return filter;
|
|
1812
1793
|
}
|
|
1794
|
+
return filter;
|
|
1813
1795
|
};
|
|
1814
1796
|
}
|
|
1815
1797
|
/**
|
|
@@ -2045,11 +2027,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
2045
2027
|
* @returns observable that emits `true` when more items can be loaded
|
|
2046
2028
|
*/ function iterationHasNextAndCanLoadMore(iteration) {
|
|
2047
2029
|
return iteration.canLoadMore$.pipe(switchMap(function(canLoadMore) {
|
|
2048
|
-
|
|
2049
|
-
return iteration.hasNext$;
|
|
2050
|
-
} else {
|
|
2051
|
-
return of(false);
|
|
2052
|
-
}
|
|
2030
|
+
return canLoadMore ? iteration.hasNext$ : of(false);
|
|
2053
2031
|
}), shareReplay(1));
|
|
2054
2032
|
}
|
|
2055
2033
|
/**
|
|
@@ -2235,9 +2213,8 @@ function scanIntoArray() {
|
|
|
2235
2213
|
result = result.pipe(first());
|
|
2236
2214
|
}
|
|
2237
2215
|
return result;
|
|
2238
|
-
} else {
|
|
2239
|
-
return of([]);
|
|
2240
2216
|
}
|
|
2217
|
+
return of([]);
|
|
2241
2218
|
});
|
|
2242
2219
|
}
|
|
2243
2220
|
|
|
@@ -2363,16 +2340,12 @@ function scanIntoArray() {
|
|
|
2363
2340
|
* @returns the inverted (or original) decision function
|
|
2364
2341
|
*/ function invertObservableDecision(decisionFn) {
|
|
2365
2342
|
var invert = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
return
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
};
|
|
2373
|
-
} else {
|
|
2374
|
-
return decisionFn;
|
|
2375
|
-
}
|
|
2343
|
+
return invert ? function(value) {
|
|
2344
|
+
var obs = decisionFn(value);
|
|
2345
|
+
return obs.pipe(map(function(x) {
|
|
2346
|
+
return !x;
|
|
2347
|
+
}));
|
|
2348
|
+
} : decisionFn;
|
|
2376
2349
|
}
|
|
2377
2350
|
/**
|
|
2378
2351
|
* RxJS operator that filters an emitted array by evaluating each item through an async {@link ObservableDecisionFunction}.
|
|
@@ -3214,20 +3187,14 @@ function _unsupported_iterable_to_array$5(o, minLen) {
|
|
|
3214
3187
|
var error = errorFactory();
|
|
3215
3188
|
onError === null || onError === void 0 ? void 0 : onError(error);
|
|
3216
3189
|
throw error;
|
|
3217
|
-
} else {
|
|
3218
|
-
return x;
|
|
3219
|
-
}
|
|
3220
|
-
}));
|
|
3221
|
-
} else {
|
|
3222
|
-
// switchToObs was provided.
|
|
3223
|
-
return source.pipe(switchMap(function(x) {
|
|
3224
|
-
if (counter() > maxEmissionsPerPeriod) {
|
|
3225
|
-
return switchToObs;
|
|
3226
|
-
} else {
|
|
3227
|
-
return of(x);
|
|
3228
3190
|
}
|
|
3191
|
+
return x;
|
|
3229
3192
|
}));
|
|
3230
3193
|
}
|
|
3194
|
+
// switchToObs was provided.
|
|
3195
|
+
return source.pipe(switchMap(function(x) {
|
|
3196
|
+
return counter() > maxEmissionsPerPeriod ? switchToObs : of(x);
|
|
3197
|
+
}));
|
|
3231
3198
|
};
|
|
3232
3199
|
}
|
|
3233
3200
|
|
|
@@ -3312,11 +3279,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
|
|
|
3312
3279
|
var filterFactory = searchStringFilterFunction(filter);
|
|
3313
3280
|
return switchMap(function(values) {
|
|
3314
3281
|
return search$.pipe(map(function(search) {
|
|
3315
|
-
|
|
3316
|
-
return filterFactory(search, values);
|
|
3317
|
-
} else {
|
|
3318
|
-
return values;
|
|
3319
|
-
}
|
|
3282
|
+
return search != null ? filterFactory(search, values) : values;
|
|
3320
3283
|
}));
|
|
3321
3284
|
});
|
|
3322
3285
|
}
|
|
@@ -5792,14 +5755,12 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
5792
5755
|
error: result.error,
|
|
5793
5756
|
value: result
|
|
5794
5757
|
};
|
|
5795
|
-
} else {
|
|
5796
|
-
return successPageResult(nextPageNumber, result);
|
|
5797
5758
|
}
|
|
5759
|
+
return successPageResult(nextPageNumber, result);
|
|
5798
5760
|
}), startWithBeginLoading(page), shareReplay(1));
|
|
5799
5761
|
return stateObs;
|
|
5800
|
-
} else {
|
|
5801
|
-
return of(prevResult).pipe();
|
|
5802
5762
|
}
|
|
5763
|
+
return of(prevResult).pipe();
|
|
5803
5764
|
}), map(function(inputState) {
|
|
5804
5765
|
var state;
|
|
5805
5766
|
if (inputState != null) {
|
|
@@ -6043,11 +6004,11 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
6043
6004
|
*/ function isItemPageIteratorResultEndResult(result) {
|
|
6044
6005
|
if (result.error != null) {
|
|
6045
6006
|
return false;
|
|
6046
|
-
}
|
|
6007
|
+
}
|
|
6008
|
+
if (result.end != null) {
|
|
6047
6009
|
return result.end;
|
|
6048
|
-
} else {
|
|
6049
|
-
return !hasValueOrNotEmpty(result);
|
|
6050
6010
|
}
|
|
6011
|
+
return !hasValueOrNotEmpty(result);
|
|
6051
6012
|
}
|
|
6052
6013
|
function itemPageIteratorShouldLoadNextPage(request, hasNextAndCanLoadMore, prevResult) {
|
|
6053
6014
|
return hasNextAndCanLoadMore && // Must be able to load more
|
package/package.json
CHANGED