@dereekb/rxjs 13.6.17 → 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 CHANGED
@@ -42,6 +42,7 @@ function _class_call_check$9(instance, Constructor) {
42
42
  * ```
43
43
  *
44
44
  * @param path - Relative path from the environment's base asset directory.
45
+ * @returns A local asset reference with the given path.
45
46
  */ function localAsset(path) {
46
47
  return {
47
48
  sourceType: 'local',
@@ -61,6 +62,7 @@ function _class_call_check$9(instance, Constructor) {
61
62
  * ```
62
63
  *
63
64
  * @param url - Absolute URL with http/https prefix to fetch the asset from.
65
+ * @returns A remote asset reference with the given URL.
64
66
  * @throws Error if the URL does not have a valid http/https prefix.
65
67
  */ function remoteAsset(url) {
66
68
  if (!util.isWebsiteUrlWithPrefix(url)) {
@@ -90,6 +92,7 @@ function _class_call_check$9(instance, Constructor) {
90
92
  * ```
91
93
  *
92
94
  * @param folder - Base folder path for the assets.
95
+ * @returns A fluent builder for creating local asset refs within the specified folder.
93
96
  */ function assetFolder(folder) {
94
97
  var normalizedFolder = folder.endsWith('/') ? folder : folder + '/';
95
98
  var builder = {
@@ -126,6 +129,7 @@ function _class_call_check$9(instance, Constructor) {
126
129
  * ```
127
130
  *
128
131
  * @param baseUrl - Base URL with http/https prefix.
132
+ * @returns A fluent builder for creating remote asset refs under the specified base URL.
129
133
  * @throws Error if the base URL does not have a valid http/https prefix.
130
134
  */ function remoteAssetBaseUrl(baseUrl) {
131
135
  if (!util.isWebsiteUrlWithPrefix(baseUrl)) {
@@ -162,6 +166,7 @@ function _class_call_check$9(instance, Constructor) {
162
166
  *
163
167
  * @param ref - The asset path reference this instance represents.
164
168
  * @param getFn - Promise-based function that loads the asset bytes.
169
+ * @returns An {@link AssetLoaderAssetInstance} with a cold observable that invokes getFn on each subscription.
165
170
  */ function assetLoaderAssetInstance(ref, getFn) {
166
171
  return {
167
172
  ref: function ref1() {
@@ -189,6 +194,7 @@ function _class_call_check$9(instance, Constructor) {
189
194
  * ```
190
195
  *
191
196
  * @param getFn - Promise-based function that loads any asset's bytes.
197
+ * @returns An {@link AssetLoader} that creates instances using the provided get function.
192
198
  */ function assetLoaderFromGetFn(getFn) {
193
199
  var loader = {
194
200
  get: function get(ref) {
@@ -217,6 +223,7 @@ function _class_call_check$9(instance, Constructor) {
217
223
  * ```
218
224
  *
219
225
  * @param config - Specifies the local and remote delegate loaders.
226
+ * @returns An {@link AssetLoader} that routes requests to the appropriate delegate based on source type.
220
227
  */ function delegatedAssetLoader(config) {
221
228
  var local = config.local, remote = config.remote;
222
229
  var loader = {
@@ -374,6 +381,7 @@ function _ts_generator$3(thisArg, body) {
374
381
  * ```
375
382
  *
376
383
  * @param config - Optional fetch configuration with custom fetch function.
384
+ * @returns An {@link AssetLoader} that loads remote assets via HTTP fetch.
377
385
  */ function fetchAssetLoader() {
378
386
  var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
379
387
  var _config_fetch;
@@ -552,6 +560,7 @@ function _ts_generator$2(thisArg, body) {
552
560
  * ```
553
561
  *
554
562
  * @param assets - Map of asset refs to their raw byte data.
563
+ * @returns An {@link AssetLoader} backed by the provided in-memory map.
555
564
  */ function memoryAssetLoader(assets) {
556
565
  var getFn = function getFn(ref) {
557
566
  return _async_to_generator$2(function() {
@@ -572,11 +581,7 @@ function _ts_generator$2(thisArg, body) {
572
581
  }
573
582
 
574
583
  function asObservable(valueOrObs) {
575
- if (rxjs.isObservable(valueOrObs)) {
576
- return valueOrObs;
577
- } else {
578
- return rxjs.of(valueOrObs);
579
- }
584
+ return rxjs.isObservable(valueOrObs) ? valueOrObs : rxjs.of(valueOrObs);
580
585
  }
581
586
  /**
582
587
  * RxJS operator that flattens an emitted {@link ObservableOrValue} into its unwrapped value via `switchMap`.
@@ -804,11 +809,7 @@ function _unsupported_iterable_to_array$b(o, minLen) {
804
809
  */ function switchMapMaybeDefault() {
805
810
  var defaultValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : undefined;
806
811
  return rxjs.switchMap(function(x) {
807
- if (x != null) {
808
- return x;
809
- } else {
810
- return rxjs.of(defaultValue);
811
- }
812
+ return x != null ? x : rxjs.of(defaultValue);
812
813
  });
813
814
  }
814
815
  function switchMapToDefault(defaultObs, useDefault) {
@@ -817,11 +818,7 @@ function switchMapToDefault(defaultObs, useDefault) {
817
818
  };
818
819
  return rxjs.switchMap(function(x) {
819
820
  return useDefaultFn(x).pipe(rxjs.switchMap(function(useDefault) {
820
- if (useDefault) {
821
- return asObservableFromGetter(defaultObs);
822
- } else {
823
- return rxjs.of(x);
824
- }
821
+ return useDefault ? asObservableFromGetter(defaultObs) : rxjs.of(x);
825
822
  }));
826
823
  });
827
824
  }
@@ -854,11 +851,7 @@ function switchMapWhileFalse(obs, otherwise) {
854
851
  }
855
852
  function switchMapOnBoolean(switchOnValue, obs, otherwise) {
856
853
  return rxjs.switchMap(function(x) {
857
- if (x === switchOnValue) {
858
- return asObservableFromGetter(obs);
859
- } else {
860
- return otherwise != null ? asObservableFromGetter(otherwise) : rxjs.EMPTY;
861
- }
854
+ return x === switchOnValue ? asObservableFromGetter(obs) : otherwise != null ? asObservableFromGetter(otherwise) : rxjs.EMPTY;
862
855
  });
863
856
  }
864
857
  /**
@@ -1425,9 +1418,8 @@ function _unsupported_iterable_to_array$9(o, minLen) {
1425
1418
  return true;
1426
1419
  }), rxjs.skip(1) // skip the first emission
1427
1420
  );
1428
- } else {
1429
- return rxjs.EMPTY;
1430
1421
  }
1422
+ return rxjs.EMPTY;
1431
1423
  }), rxjs.defaultIfEmpty(false)).subscribe(function(clear) {
1432
1424
  if (clear) {
1433
1425
  _this.resetFilter();
@@ -1800,9 +1792,8 @@ var FilterMapItem = /*#__PURE__*/ function() {
1800
1792
  var result = fn(filter);
1801
1793
  delete result.preset;
1802
1794
  return result;
1803
- } else {
1804
- return filter;
1805
1795
  }
1796
+ return filter;
1806
1797
  };
1807
1798
  }
1808
1799
  /**
@@ -2038,11 +2029,7 @@ function _ts_generator$1(thisArg, body) {
2038
2029
  * @returns observable that emits `true` when more items can be loaded
2039
2030
  */ function iterationHasNextAndCanLoadMore(iteration) {
2040
2031
  return iteration.canLoadMore$.pipe(rxjs.switchMap(function(canLoadMore) {
2041
- if (canLoadMore) {
2042
- return iteration.hasNext$;
2043
- } else {
2044
- return rxjs.of(false);
2045
- }
2032
+ return canLoadMore ? iteration.hasNext$ : rxjs.of(false);
2046
2033
  }), rxjs.shareReplay(1));
2047
2034
  }
2048
2035
  /**
@@ -2228,9 +2215,8 @@ function scanIntoArray() {
2228
2215
  result = result.pipe(rxjs.first());
2229
2216
  }
2230
2217
  return result;
2231
- } else {
2232
- return rxjs.of([]);
2233
2218
  }
2219
+ return rxjs.of([]);
2234
2220
  });
2235
2221
  }
2236
2222
 
@@ -2356,16 +2342,12 @@ function scanIntoArray() {
2356
2342
  * @returns the inverted (or original) decision function
2357
2343
  */ function invertObservableDecision(decisionFn) {
2358
2344
  var invert = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
2359
- if (invert) {
2360
- return function(value) {
2361
- var obs = decisionFn(value);
2362
- return obs.pipe(rxjs.map(function(x) {
2363
- return !x;
2364
- }));
2365
- };
2366
- } else {
2367
- return decisionFn;
2368
- }
2345
+ return invert ? function(value) {
2346
+ var obs = decisionFn(value);
2347
+ return obs.pipe(rxjs.map(function(x) {
2348
+ return !x;
2349
+ }));
2350
+ } : decisionFn;
2369
2351
  }
2370
2352
  /**
2371
2353
  * RxJS operator that filters an emitted array by evaluating each item through an async {@link ObservableDecisionFunction}.
@@ -3207,20 +3189,14 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3207
3189
  var error = errorFactory();
3208
3190
  onError === null || onError === void 0 ? void 0 : onError(error);
3209
3191
  throw error;
3210
- } else {
3211
- return x;
3212
- }
3213
- }));
3214
- } else {
3215
- // switchToObs was provided.
3216
- return source.pipe(rxjs.switchMap(function(x) {
3217
- if (counter() > maxEmissionsPerPeriod) {
3218
- return switchToObs;
3219
- } else {
3220
- return rxjs.of(x);
3221
3192
  }
3193
+ return x;
3222
3194
  }));
3223
3195
  }
3196
+ // switchToObs was provided.
3197
+ return source.pipe(rxjs.switchMap(function(x) {
3198
+ return counter() > maxEmissionsPerPeriod ? switchToObs : rxjs.of(x);
3199
+ }));
3224
3200
  };
3225
3201
  }
3226
3202
 
@@ -3305,11 +3281,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3305
3281
  var filterFactory = util.searchStringFilterFunction(filter);
3306
3282
  return rxjs.switchMap(function(values) {
3307
3283
  return search$.pipe(rxjs.map(function(search) {
3308
- if (search != null) {
3309
- return filterFactory(search, values);
3310
- } else {
3311
- return values;
3312
- }
3284
+ return search != null ? filterFactory(search, values) : values;
3313
3285
  }));
3314
3286
  });
3315
3287
  }
@@ -5785,21 +5757,27 @@ function _unsupported_iterable_to_array(o, minLen) {
5785
5757
  error: result.error,
5786
5758
  value: result
5787
5759
  };
5788
- } else {
5789
- return successPageResult(nextPageNumber, result);
5790
5760
  }
5761
+ return successPageResult(nextPageNumber, result);
5791
5762
  }), startWithBeginLoading(page), rxjs.shareReplay(1));
5792
5763
  return stateObs;
5793
- } else {
5794
- return rxjs.of(prevResult).pipe();
5795
5764
  }
5765
+ return rxjs.of(prevResult).pipe();
5796
5766
  }), rxjs.map(function(inputState) {
5797
5767
  var state;
5798
5768
  if (inputState != null) {
5799
5769
  var end = inputState.value != null ? isItemPageIteratorResultEndResult(inputState.value) : undefined;
5800
- state = _object_spread_props$1(_object_spread$1({}, inputState), {
5801
- hasNextPage: util.invertMaybeBoolean(end)
5802
- });
5770
+ var hasNextPage = util.invertMaybeBoolean(end);
5771
+ // Reuse the same reference when hasNextPage hasn't changed to avoid
5772
+ // tricking downstream distinctUntilChanged/scan into treating a
5773
+ // re-emitted result as a new page (which causes duplicate accumulation).
5774
+ if (inputState.hasNextPage === hasNextPage) {
5775
+ state = inputState;
5776
+ } else {
5777
+ state = _object_spread_props$1(_object_spread$1({}, inputState), {
5778
+ hasNextPage: hasNextPage
5779
+ });
5780
+ }
5803
5781
  }
5804
5782
  return {
5805
5783
  n: request.n,
@@ -6028,11 +6006,11 @@ function _unsupported_iterable_to_array(o, minLen) {
6028
6006
  */ function isItemPageIteratorResultEndResult(result) {
6029
6007
  if (result.error != null) {
6030
6008
  return false;
6031
- } else if (result.end != null) {
6009
+ }
6010
+ if (result.end != null) {
6032
6011
  return result.end;
6033
- } else {
6034
- return !util.hasValueOrNotEmpty(result);
6035
6012
  }
6013
+ return !util.hasValueOrNotEmpty(result);
6036
6014
  }
6037
6015
  function itemPageIteratorShouldLoadNextPage(request, hasNextAndCanLoadMore, prevResult) {
6038
6016
  return hasNextAndCanLoadMore && // Must be able to load more
package/index.esm.js CHANGED
@@ -40,6 +40,7 @@ function _class_call_check$9(instance, Constructor) {
40
40
  * ```
41
41
  *
42
42
  * @param path - Relative path from the environment's base asset directory.
43
+ * @returns A local asset reference with the given path.
43
44
  */ function localAsset(path) {
44
45
  return {
45
46
  sourceType: 'local',
@@ -59,6 +60,7 @@ function _class_call_check$9(instance, Constructor) {
59
60
  * ```
60
61
  *
61
62
  * @param url - Absolute URL with http/https prefix to fetch the asset from.
63
+ * @returns A remote asset reference with the given URL.
62
64
  * @throws Error if the URL does not have a valid http/https prefix.
63
65
  */ function remoteAsset(url) {
64
66
  if (!isWebsiteUrlWithPrefix(url)) {
@@ -88,6 +90,7 @@ function _class_call_check$9(instance, Constructor) {
88
90
  * ```
89
91
  *
90
92
  * @param folder - Base folder path for the assets.
93
+ * @returns A fluent builder for creating local asset refs within the specified folder.
91
94
  */ function assetFolder(folder) {
92
95
  var normalizedFolder = folder.endsWith('/') ? folder : folder + '/';
93
96
  var builder = {
@@ -124,6 +127,7 @@ function _class_call_check$9(instance, Constructor) {
124
127
  * ```
125
128
  *
126
129
  * @param baseUrl - Base URL with http/https prefix.
130
+ * @returns A fluent builder for creating remote asset refs under the specified base URL.
127
131
  * @throws Error if the base URL does not have a valid http/https prefix.
128
132
  */ function remoteAssetBaseUrl(baseUrl) {
129
133
  if (!isWebsiteUrlWithPrefix(baseUrl)) {
@@ -160,6 +164,7 @@ function _class_call_check$9(instance, Constructor) {
160
164
  *
161
165
  * @param ref - The asset path reference this instance represents.
162
166
  * @param getFn - Promise-based function that loads the asset bytes.
167
+ * @returns An {@link AssetLoaderAssetInstance} with a cold observable that invokes getFn on each subscription.
163
168
  */ function assetLoaderAssetInstance(ref, getFn) {
164
169
  return {
165
170
  ref: function ref1() {
@@ -187,6 +192,7 @@ function _class_call_check$9(instance, Constructor) {
187
192
  * ```
188
193
  *
189
194
  * @param getFn - Promise-based function that loads any asset's bytes.
195
+ * @returns An {@link AssetLoader} that creates instances using the provided get function.
190
196
  */ function assetLoaderFromGetFn(getFn) {
191
197
  var loader = {
192
198
  get: function get(ref) {
@@ -215,6 +221,7 @@ function _class_call_check$9(instance, Constructor) {
215
221
  * ```
216
222
  *
217
223
  * @param config - Specifies the local and remote delegate loaders.
224
+ * @returns An {@link AssetLoader} that routes requests to the appropriate delegate based on source type.
218
225
  */ function delegatedAssetLoader(config) {
219
226
  var local = config.local, remote = config.remote;
220
227
  var loader = {
@@ -372,6 +379,7 @@ function _ts_generator$3(thisArg, body) {
372
379
  * ```
373
380
  *
374
381
  * @param config - Optional fetch configuration with custom fetch function.
382
+ * @returns An {@link AssetLoader} that loads remote assets via HTTP fetch.
375
383
  */ function fetchAssetLoader() {
376
384
  var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
377
385
  var _config_fetch;
@@ -550,6 +558,7 @@ function _ts_generator$2(thisArg, body) {
550
558
  * ```
551
559
  *
552
560
  * @param assets - Map of asset refs to their raw byte data.
561
+ * @returns An {@link AssetLoader} backed by the provided in-memory map.
553
562
  */ function memoryAssetLoader(assets) {
554
563
  var getFn = function getFn(ref) {
555
564
  return _async_to_generator$2(function() {
@@ -570,11 +579,7 @@ function _ts_generator$2(thisArg, body) {
570
579
  }
571
580
 
572
581
  function asObservable(valueOrObs) {
573
- if (isObservable(valueOrObs)) {
574
- return valueOrObs;
575
- } else {
576
- return of(valueOrObs);
577
- }
582
+ return isObservable(valueOrObs) ? valueOrObs : of(valueOrObs);
578
583
  }
579
584
  /**
580
585
  * RxJS operator that flattens an emitted {@link ObservableOrValue} into its unwrapped value via `switchMap`.
@@ -802,11 +807,7 @@ function _unsupported_iterable_to_array$b(o, minLen) {
802
807
  */ function switchMapMaybeDefault() {
803
808
  var defaultValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : undefined;
804
809
  return switchMap(function(x) {
805
- if (x != null) {
806
- return x;
807
- } else {
808
- return of(defaultValue);
809
- }
810
+ return x != null ? x : of(defaultValue);
810
811
  });
811
812
  }
812
813
  function switchMapToDefault(defaultObs, useDefault) {
@@ -815,11 +816,7 @@ function switchMapToDefault(defaultObs, useDefault) {
815
816
  };
816
817
  return switchMap(function(x) {
817
818
  return useDefaultFn(x).pipe(switchMap(function(useDefault) {
818
- if (useDefault) {
819
- return asObservableFromGetter(defaultObs);
820
- } else {
821
- return of(x);
822
- }
819
+ return useDefault ? asObservableFromGetter(defaultObs) : of(x);
823
820
  }));
824
821
  });
825
822
  }
@@ -852,11 +849,7 @@ function switchMapWhileFalse(obs, otherwise) {
852
849
  }
853
850
  function switchMapOnBoolean(switchOnValue, obs, otherwise) {
854
851
  return switchMap(function(x) {
855
- if (x === switchOnValue) {
856
- return asObservableFromGetter(obs);
857
- } else {
858
- return otherwise != null ? asObservableFromGetter(otherwise) : EMPTY;
859
- }
852
+ return x === switchOnValue ? asObservableFromGetter(obs) : otherwise != null ? asObservableFromGetter(otherwise) : EMPTY;
860
853
  });
861
854
  }
862
855
  /**
@@ -1423,9 +1416,8 @@ function _unsupported_iterable_to_array$9(o, minLen) {
1423
1416
  return true;
1424
1417
  }), skip(1) // skip the first emission
1425
1418
  );
1426
- } else {
1427
- return EMPTY;
1428
1419
  }
1420
+ return EMPTY;
1429
1421
  }), defaultIfEmpty(false)).subscribe(function(clear) {
1430
1422
  if (clear) {
1431
1423
  _this.resetFilter();
@@ -1798,9 +1790,8 @@ var FilterMapItem = /*#__PURE__*/ function() {
1798
1790
  var result = fn(filter);
1799
1791
  delete result.preset;
1800
1792
  return result;
1801
- } else {
1802
- return filter;
1803
1793
  }
1794
+ return filter;
1804
1795
  };
1805
1796
  }
1806
1797
  /**
@@ -2036,11 +2027,7 @@ function _ts_generator$1(thisArg, body) {
2036
2027
  * @returns observable that emits `true` when more items can be loaded
2037
2028
  */ function iterationHasNextAndCanLoadMore(iteration) {
2038
2029
  return iteration.canLoadMore$.pipe(switchMap(function(canLoadMore) {
2039
- if (canLoadMore) {
2040
- return iteration.hasNext$;
2041
- } else {
2042
- return of(false);
2043
- }
2030
+ return canLoadMore ? iteration.hasNext$ : of(false);
2044
2031
  }), shareReplay(1));
2045
2032
  }
2046
2033
  /**
@@ -2226,9 +2213,8 @@ function scanIntoArray() {
2226
2213
  result = result.pipe(first());
2227
2214
  }
2228
2215
  return result;
2229
- } else {
2230
- return of([]);
2231
2216
  }
2217
+ return of([]);
2232
2218
  });
2233
2219
  }
2234
2220
 
@@ -2354,16 +2340,12 @@ function scanIntoArray() {
2354
2340
  * @returns the inverted (or original) decision function
2355
2341
  */ function invertObservableDecision(decisionFn) {
2356
2342
  var invert = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
2357
- if (invert) {
2358
- return function(value) {
2359
- var obs = decisionFn(value);
2360
- return obs.pipe(map(function(x) {
2361
- return !x;
2362
- }));
2363
- };
2364
- } else {
2365
- return decisionFn;
2366
- }
2343
+ return invert ? function(value) {
2344
+ var obs = decisionFn(value);
2345
+ return obs.pipe(map(function(x) {
2346
+ return !x;
2347
+ }));
2348
+ } : decisionFn;
2367
2349
  }
2368
2350
  /**
2369
2351
  * RxJS operator that filters an emitted array by evaluating each item through an async {@link ObservableDecisionFunction}.
@@ -3205,20 +3187,14 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3205
3187
  var error = errorFactory();
3206
3188
  onError === null || onError === void 0 ? void 0 : onError(error);
3207
3189
  throw error;
3208
- } else {
3209
- return x;
3210
- }
3211
- }));
3212
- } else {
3213
- // switchToObs was provided.
3214
- return source.pipe(switchMap(function(x) {
3215
- if (counter() > maxEmissionsPerPeriod) {
3216
- return switchToObs;
3217
- } else {
3218
- return of(x);
3219
3190
  }
3191
+ return x;
3220
3192
  }));
3221
3193
  }
3194
+ // switchToObs was provided.
3195
+ return source.pipe(switchMap(function(x) {
3196
+ return counter() > maxEmissionsPerPeriod ? switchToObs : of(x);
3197
+ }));
3222
3198
  };
3223
3199
  }
3224
3200
 
@@ -3303,11 +3279,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3303
3279
  var filterFactory = searchStringFilterFunction(filter);
3304
3280
  return switchMap(function(values) {
3305
3281
  return search$.pipe(map(function(search) {
3306
- if (search != null) {
3307
- return filterFactory(search, values);
3308
- } else {
3309
- return values;
3310
- }
3282
+ return search != null ? filterFactory(search, values) : values;
3311
3283
  }));
3312
3284
  });
3313
3285
  }
@@ -5783,21 +5755,27 @@ function _unsupported_iterable_to_array(o, minLen) {
5783
5755
  error: result.error,
5784
5756
  value: result
5785
5757
  };
5786
- } else {
5787
- return successPageResult(nextPageNumber, result);
5788
5758
  }
5759
+ return successPageResult(nextPageNumber, result);
5789
5760
  }), startWithBeginLoading(page), shareReplay(1));
5790
5761
  return stateObs;
5791
- } else {
5792
- return of(prevResult).pipe();
5793
5762
  }
5763
+ return of(prevResult).pipe();
5794
5764
  }), map(function(inputState) {
5795
5765
  var state;
5796
5766
  if (inputState != null) {
5797
5767
  var end = inputState.value != null ? isItemPageIteratorResultEndResult(inputState.value) : undefined;
5798
- state = _object_spread_props$1(_object_spread$1({}, inputState), {
5799
- hasNextPage: invertMaybeBoolean(end)
5800
- });
5768
+ var hasNextPage = invertMaybeBoolean(end);
5769
+ // Reuse the same reference when hasNextPage hasn't changed to avoid
5770
+ // tricking downstream distinctUntilChanged/scan into treating a
5771
+ // re-emitted result as a new page (which causes duplicate accumulation).
5772
+ if (inputState.hasNextPage === hasNextPage) {
5773
+ state = inputState;
5774
+ } else {
5775
+ state = _object_spread_props$1(_object_spread$1({}, inputState), {
5776
+ hasNextPage: hasNextPage
5777
+ });
5778
+ }
5801
5779
  }
5802
5780
  return {
5803
5781
  n: request.n,
@@ -6026,11 +6004,11 @@ function _unsupported_iterable_to_array(o, minLen) {
6026
6004
  */ function isItemPageIteratorResultEndResult(result) {
6027
6005
  if (result.error != null) {
6028
6006
  return false;
6029
- } else if (result.end != null) {
6007
+ }
6008
+ if (result.end != null) {
6030
6009
  return result.end;
6031
- } else {
6032
- return !hasValueOrNotEmpty(result);
6033
6010
  }
6011
+ return !hasValueOrNotEmpty(result);
6034
6012
  }
6035
6013
  function itemPageIteratorShouldLoadNextPage(request, hasNextAndCanLoadMore, prevResult) {
6036
6014
  return hasNextAndCanLoadMore && // Must be able to load more
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@dereekb/rxjs",
3
- "version": "13.6.17",
3
+ "version": "13.8.0",
4
4
  "peerDependencies": {
5
5
  "rxjs": "^7.8.0",
6
- "@dereekb/util": "13.6.17"
6
+ "@dereekb/util": "13.8.0"
7
7
  },
8
8
  "exports": {
9
9
  "./package.json": "./package.json",
@@ -10,6 +10,7 @@ import { type AssetLocalPathRef, type AssetRemotePathRef } from './asset';
10
10
  * ```
11
11
  *
12
12
  * @param path - Relative path from the environment's base asset directory.
13
+ * @returns A local asset reference with the given path.
13
14
  */
14
15
  export declare function localAsset(path: SlashPath): AssetLocalPathRef;
15
16
  /**
@@ -25,6 +26,7 @@ export declare function localAsset(path: SlashPath): AssetLocalPathRef;
25
26
  * ```
26
27
  *
27
28
  * @param url - Absolute URL with http/https prefix to fetch the asset from.
29
+ * @returns A remote asset reference with the given URL.
28
30
  * @throws Error if the URL does not have a valid http/https prefix.
29
31
  */
30
32
  export declare function remoteAsset(url: WebsiteUrlWithPrefix): AssetRemotePathRef;
@@ -65,6 +67,7 @@ export interface AssetFolderBuilder {
65
67
  * ```
66
68
  *
67
69
  * @param folder - Base folder path for the assets.
70
+ * @returns A fluent builder for creating local asset refs within the specified folder.
68
71
  */
69
72
  export declare function assetFolder(folder: SlashPath): AssetFolderBuilder;
70
73
  /**
@@ -107,6 +110,7 @@ export interface RemoteAssetBuilder {
107
110
  * ```
108
111
  *
109
112
  * @param baseUrl - Base URL with http/https prefix.
113
+ * @returns A fluent builder for creating remote asset refs under the specified base URL.
110
114
  * @throws Error if the base URL does not have a valid http/https prefix.
111
115
  */
112
116
  export declare function remoteAssetBaseUrl(baseUrl: WebsiteUrlWithPrefix): RemoteAssetBuilder;
@@ -13,6 +13,7 @@ import { type AssetPathRef, type AssetLoaderAssetInstance, type AssetLoaderGetFn
13
13
  *
14
14
  * @param ref - The asset path reference this instance represents.
15
15
  * @param getFn - Promise-based function that loads the asset bytes.
16
+ * @returns An {@link AssetLoaderAssetInstance} with a cold observable that invokes getFn on each subscription.
16
17
  */
17
18
  export declare function assetLoaderAssetInstance(ref: AssetPathRef, getFn: AssetLoaderGetFn): AssetLoaderAssetInstance;
18
19
  /**
@@ -30,5 +31,6 @@ export declare function assetLoaderAssetInstance(ref: AssetPathRef, getFn: Asset
30
31
  * ```
31
32
  *
32
33
  * @param getFn - Promise-based function that loads any asset's bytes.
34
+ * @returns An {@link AssetLoader} that creates instances using the provided get function.
33
35
  */
34
36
  export declare function assetLoaderFromGetFn(getFn: AssetLoaderGetFn): AssetLoader;
@@ -32,5 +32,6 @@ export interface DelegatedAssetLoaderConfig {
32
32
  * ```
33
33
  *
34
34
  * @param config - Specifies the local and remote delegate loaders.
35
+ * @returns An {@link AssetLoader} that routes requests to the appropriate delegate based on source type.
35
36
  */
36
37
  export declare function delegatedAssetLoader(config: DelegatedAssetLoaderConfig): AssetLoader;
@@ -29,5 +29,6 @@ export interface FetchAssetLoaderConfig {
29
29
  * ```
30
30
  *
31
31
  * @param config - Optional fetch configuration with custom fetch function.
32
+ * @returns An {@link AssetLoader} that loads remote assets via HTTP fetch.
32
33
  */
33
34
  export declare function fetchAssetLoader(config?: FetchAssetLoaderConfig): AssetLoader;
@@ -17,5 +17,6 @@ import { type AssetPathRef, type AssetLoader } from './asset';
17
17
  * ```
18
18
  *
19
19
  * @param assets - Map of asset refs to their raw byte data.
20
+ * @returns An {@link AssetLoader} backed by the provided in-memory map.
20
21
  */
21
22
  export declare function memoryAssetLoader(assets: Map<AssetPathRef, ArrayBuffer>): AssetLoader;