@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.
Files changed (53) hide show
  1. package/index.cjs.js +478 -442
  2. package/index.esm.js +478 -442
  3. package/package.json +2 -2
  4. package/src/lib/asset/asset.builder.d.ts +14 -14
  5. package/src/lib/asset/asset.loader.d.ts +7 -7
  6. package/src/lib/asset/asset.loader.delegated.d.ts +3 -3
  7. package/src/lib/asset/asset.loader.fetch.d.ts +3 -3
  8. package/src/lib/asset/asset.loader.memory.d.ts +3 -3
  9. package/src/lib/filter/filter.map.d.ts +12 -12
  10. package/src/lib/filter/filter.preset.d.ts +5 -4
  11. package/src/lib/filter/filter.source.d.ts +4 -4
  12. package/src/lib/iterator/iteration.accumulator.d.ts +3 -4
  13. package/src/lib/iterator/iteration.accumulator.rxjs.d.ts +8 -8
  14. package/src/lib/iterator/iteration.mapped.d.ts +4 -4
  15. package/src/lib/iterator/iteration.mapped.page.d.ts +3 -3
  16. package/src/lib/iterator/iteration.next.d.ts +11 -13
  17. package/src/lib/iterator/iterator.page.d.ts +4 -4
  18. package/src/lib/loading/loading.context.rxjs.d.ts +2 -2
  19. package/src/lib/loading/loading.context.simple.d.ts +4 -4
  20. package/src/lib/loading/loading.context.state.d.ts +6 -6
  21. package/src/lib/loading/loading.context.state.list.d.ts +3 -3
  22. package/src/lib/loading/loading.state.d.ts +68 -68
  23. package/src/lib/loading/loading.state.list.d.ts +12 -12
  24. package/src/lib/loading/loading.state.rxjs.d.ts +18 -18
  25. package/src/lib/lock.d.ts +25 -25
  26. package/src/lib/object.d.ts +1 -1
  27. package/src/lib/rxjs/array.d.ts +7 -7
  28. package/src/lib/rxjs/boolean.d.ts +6 -6
  29. package/src/lib/rxjs/decision.d.ts +6 -6
  30. package/src/lib/rxjs/delta.d.ts +7 -7
  31. package/src/lib/rxjs/expires.d.ts +13 -13
  32. package/src/lib/rxjs/factory.d.ts +7 -7
  33. package/src/lib/rxjs/getter.d.ts +4 -4
  34. package/src/lib/rxjs/key.d.ts +4 -4
  35. package/src/lib/rxjs/lifecycle.d.ts +5 -5
  36. package/src/lib/rxjs/loading.d.ts +2 -2
  37. package/src/lib/rxjs/map.d.ts +3 -3
  38. package/src/lib/rxjs/misc.d.ts +6 -5
  39. package/src/lib/rxjs/model.d.ts +2 -2
  40. package/src/lib/rxjs/number.d.ts +4 -4
  41. package/src/lib/rxjs/rxjs.async.d.ts +5 -5
  42. package/src/lib/rxjs/rxjs.d.ts +12 -12
  43. package/src/lib/rxjs/rxjs.error.d.ts +3 -3
  44. package/src/lib/rxjs/rxjs.map.d.ts +11 -11
  45. package/src/lib/rxjs/rxjs.unique.d.ts +3 -3
  46. package/src/lib/rxjs/set.d.ts +12 -12
  47. package/src/lib/rxjs/string.d.ts +3 -3
  48. package/src/lib/rxjs/timeout.d.ts +9 -9
  49. package/src/lib/rxjs/use.d.ts +2 -2
  50. package/src/lib/rxjs/value.d.ts +49 -45
  51. package/src/lib/subscription.d.ts +7 -7
  52. package/src/lib/work/work.factory.d.ts +8 -6
  53. package/src/lib/work/work.instance.d.ts +9 -8
package/index.cjs.js CHANGED
@@ -35,14 +35,14 @@ function _class_call_check$9(instance, Constructor) {
35
35
  /**
36
36
  * Creates a local {@link AssetLocalPathRef}.
37
37
  *
38
+ * @param path - Relative path from the environment's base asset directory.
39
+ * @returns A local asset reference with the given path.
40
+ *
38
41
  * @example
39
42
  * ```ts
40
43
  * const DISTRICTS = localAsset('data/school-districts.json');
41
44
  * // { sourceType: 'local', path: 'data/school-districts.json' }
42
45
  * ```
43
- *
44
- * @param path - Relative path from the environment's base asset directory.
45
- * @returns A local asset reference with the given path.
46
46
  */ function localAsset(path) {
47
47
  return {
48
48
  sourceType: 'local',
@@ -55,15 +55,15 @@ function _class_call_check$9(instance, Constructor) {
55
55
  * Remote assets always use absolute URLs with an http:// or https:// prefix.
56
56
  * Throws if the provided URL does not have a valid prefix.
57
57
  *
58
+ * @param url - Absolute URL with http/https prefix to fetch the asset from.
59
+ * @returns A remote asset reference with the given URL.
60
+ * @throws {Error} If the URL does not have a valid http/https prefix.
61
+ *
58
62
  * @example
59
63
  * ```ts
60
64
  * const CDN = remoteAsset('https://cdn.example.com/geo.json');
61
65
  * // { sourceType: 'remote', url: 'https://cdn.example.com/geo.json' }
62
66
  * ```
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.
66
- * @throws Error if the URL does not have a valid http/https prefix.
67
67
  */ function remoteAsset(url) {
68
68
  if (!util.isWebsiteUrlWithPrefix(url)) {
69
69
  throw new Error('remoteAsset() requires a URL with http:// or https:// prefix, got: "'.concat(url, '"'));
@@ -77,6 +77,9 @@ function _class_call_check$9(instance, Constructor) {
77
77
  * Creates a fluent builder for creating multiple local asset refs
78
78
  * from the same folder.
79
79
  *
80
+ * @param folder - Base folder path for the assets.
81
+ * @returns A fluent builder for creating local asset refs within the specified folder.
82
+ *
80
83
  * @example
81
84
  * ```ts
82
85
  * const DATA = assetFolder('data');
@@ -90,9 +93,6 @@ function _class_call_check$9(instance, Constructor) {
90
93
  * // { sourceType: 'local', path: 'data/b.txt' }
91
94
  * // ]
92
95
  * ```
93
- *
94
- * @param folder - Base folder path for the assets.
95
- * @returns A fluent builder for creating local asset refs within the specified folder.
96
96
  */ function assetFolder(folder) {
97
97
  var normalizedFolder = folder.endsWith('/') ? folder : folder + '/';
98
98
  var builder = {
@@ -114,6 +114,10 @@ function _class_call_check$9(instance, Constructor) {
114
114
  * The base URL must be a valid {@link WebsiteUrlWithPrefix}.
115
115
  * Each child path is appended to produce a full absolute URL.
116
116
  *
117
+ * @param baseUrl - Base URL with http/https prefix.
118
+ * @returns A fluent builder for creating remote asset refs under the specified base URL.
119
+ * @throws {Error} If the base URL does not have a valid http/https prefix.
120
+ *
117
121
  * @example
118
122
  * ```ts
119
123
  * const CDN = remoteAssetBaseUrl('https://cdn.example.com/assets');
@@ -127,10 +131,6 @@ function _class_call_check$9(instance, Constructor) {
127
131
  * // { sourceType: 'remote', url: 'https://cdn.example.com/assets/b.json' }
128
132
  * // ]
129
133
  * ```
130
- *
131
- * @param baseUrl - Base URL with http/https prefix.
132
- * @returns A fluent builder for creating remote asset refs under the specified base URL.
133
- * @throws Error if the base URL does not have a valid http/https prefix.
134
134
  */ function remoteAssetBaseUrl(baseUrl) {
135
135
  if (!util.isWebsiteUrlWithPrefix(baseUrl)) {
136
136
  throw new Error('remoteAssetBaseUrl() requires a URL with http:// or https:// prefix, got: "'.concat(baseUrl, '"'));
@@ -158,15 +158,15 @@ function _class_call_check$9(instance, Constructor) {
158
158
  * The returned {@link AssetLoaderAssetInstance.load} observable is cold — each subscription
159
159
  * invokes the get function anew.
160
160
  *
161
+ * @param ref - The asset path reference this instance represents.
162
+ * @param getFn - Promise-based function that loads the asset bytes.
163
+ * @returns An {@link AssetLoaderAssetInstance} with a cold observable that invokes getFn on each subscription.
164
+ *
161
165
  * @example
162
166
  * ```ts
163
167
  * const instance = assetLoaderAssetInstance(ref, (r) => fetch(r.path).then(res => res.arrayBuffer()));
164
168
  * instance.load().subscribe((data) => { ... });
165
169
  * ```
166
- *
167
- * @param ref - The asset path reference this instance represents.
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.
170
170
  */ function assetLoaderAssetInstance(ref, getFn) {
171
171
  return {
172
172
  ref: function ref1() {
@@ -185,6 +185,9 @@ function _class_call_check$9(instance, Constructor) {
185
185
  * This is the primary helper for building functional AssetLoader implementations
186
186
  * from a Promise-based leaf loader.
187
187
  *
188
+ * @param getFn - Promise-based function that loads any asset's bytes.
189
+ * @returns An {@link AssetLoader} that creates instances using the provided get function.
190
+ *
188
191
  * @example
189
192
  * ```ts
190
193
  * const loader = assetLoaderFromGetFn(async (ref) => {
@@ -192,9 +195,6 @@ function _class_call_check$9(instance, Constructor) {
192
195
  * return response.arrayBuffer();
193
196
  * });
194
197
  * ```
195
- *
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.
198
198
  */ function assetLoaderFromGetFn(getFn) {
199
199
  var loader = {
200
200
  get: function get(ref) {
@@ -211,6 +211,9 @@ function _class_call_check$9(instance, Constructor) {
211
211
  * loader together, and the delegated loader routes each {@link AssetPathRef}
212
212
  * to the correct one based on {@link AssetPathRef.sourceType}.
213
213
  *
214
+ * @param config - Specifies the local and remote delegate loaders.
215
+ * @returns An {@link AssetLoader} that routes requests to the appropriate delegate based on source type.
216
+ *
214
217
  * @example
215
218
  * ```ts
216
219
  * const loader = delegatedAssetLoader({
@@ -221,9 +224,6 @@ function _class_call_check$9(instance, Constructor) {
221
224
  * loader.get(localAsset('data/districts.json')); // → local loader
222
225
  * loader.get(remoteAsset('data/geo.json')); // → remote loader
223
226
  * ```
224
- *
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.
227
227
  */ function delegatedAssetLoader(config) {
228
228
  var local = config.local, remote = config.remote;
229
229
  var loader = {
@@ -369,6 +369,9 @@ function _ts_generator$3(thisArg, body) {
369
369
  *
370
370
  * Remote refs always have absolute URLs, so no base URL resolution is needed.
371
371
  *
372
+ * @param config - Optional fetch configuration with custom fetch function.
373
+ * @returns An {@link AssetLoader} that loads remote assets via HTTP fetch.
374
+ *
372
375
  * @example
373
376
  * ```ts
374
377
  * const loader = fetchAssetLoader();
@@ -379,9 +382,6 @@ function _ts_generator$3(thisArg, body) {
379
382
  * // With a custom fetch function:
380
383
  * const loader = fetchAssetLoader({ fetch: myAuthenticatedFetch });
381
384
  * ```
382
- *
383
- * @param config - Optional fetch configuration with custom fetch function.
384
- * @returns An {@link AssetLoader} that loads remote assets via HTTP fetch.
385
385
  */ function fetchAssetLoader() {
386
386
  var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
387
387
  var _config_fetch;
@@ -549,6 +549,9 @@ function _ts_generator$2(thisArg, body) {
549
549
  * Assets are matched by reference identity — the same {@link AssetPathRef}
550
550
  * object used to populate the map must be used to retrieve the data.
551
551
  *
552
+ * @param assets - Map of asset refs to their raw byte data.
553
+ * @returns An {@link AssetLoader} backed by the provided in-memory map.
554
+ *
552
555
  * @example
553
556
  * ```ts
554
557
  * const DISTRICTS = localAsset('districts.json');
@@ -558,9 +561,6 @@ function _ts_generator$2(thisArg, body) {
558
561
  *
559
562
  * loader.get(DISTRICTS).load().subscribe((data) => { ... });
560
563
  * ```
561
- *
562
- * @param assets - Map of asset refs to their raw byte data.
563
- * @returns An {@link AssetLoader} backed by the provided in-memory map.
564
564
  */ function memoryAssetLoader(assets) {
565
565
  var getFn = function getFn(ref) {
566
566
  return _async_to_generator$2(function() {
@@ -586,7 +586,7 @@ function asObservable(valueOrObs) {
586
586
  /**
587
587
  * RxJS operator that flattens an emitted {@link ObservableOrValue} into its unwrapped value via `switchMap`.
588
588
  *
589
- * @returns an operator that unwraps ObservableOrValue emissions
589
+ * @returns An operator that unwraps ObservableOrValue emissions.
590
590
  */ function valueFromObservableOrValue() {
591
591
  return rxjs.switchMap(function(x) {
592
592
  return asObservable(x);
@@ -596,7 +596,7 @@ function asObservable(valueOrObs) {
596
596
  * RxJS operator that flattens an emitted Maybe<{@link ObservableOrValue}> into its unwrapped value,
597
597
  * emitting `undefined` when the input is nullish.
598
598
  *
599
- * @returns an operator that unwraps Maybe<ObservableOrValue> emissions
599
+ * @returns An operator that unwraps Maybe<ObservableOrValue> emissions.
600
600
  */ function maybeValueFromObservableOrValue() {
601
601
  return rxjs.switchMap(function(x) {
602
602
  return x != null ? asObservable(x) : rxjs.of(undefined);
@@ -609,7 +609,7 @@ function asObservableFromGetter(input, args) {
609
609
  /**
610
610
  * RxJS operator that flattens an emitted {@link ObservableOrValueGetter} into its resolved value via `switchMap`.
611
611
  *
612
- * @returns an operator that unwraps getter emissions
612
+ * @returns An operator that unwraps getter emissions.
613
613
  */ function valueFromObservableOrValueGetter() {
614
614
  return rxjs.switchMap(function(x) {
615
615
  return asObservableFromGetter(x);
@@ -619,7 +619,7 @@ function asObservableFromGetter(input, args) {
619
619
  * RxJS operator that flattens an emitted Maybe<{@link ObservableOrValueGetter}> into its resolved value,
620
620
  * emitting `undefined` when the input is nullish.
621
621
  *
622
- * @returns an operator that unwraps Maybe<ObservableOrValueGetter> emissions, emitting undefined for nullish inputs
622
+ * @returns An operator that unwraps Maybe<ObservableOrValueGetter> emissions, emitting undefined for nullish inputs.
623
623
  */ function maybeValueFromObservableOrValueGetter() {
624
624
  return rxjs.switchMap(function(x) {
625
625
  return x != null ? asObservableFromGetter(x) : rxjs.of(undefined);
@@ -678,8 +678,9 @@ function _unsupported_iterable_to_array$b(o, minLen) {
678
678
  /**
679
679
  * Creates an {@link IsModifiedFunction} by inverting the result of an {@link IsEqualFunction}.
680
680
  *
681
- * @param isEqualFunction - equality check function to invert
682
- * @returns a function that returns true when the value has been modified
681
+ * @param isEqualFunction - Equality check function to invert.
682
+ * @returns Predicate that reports true whenever the underlying equality check signals inequality.
683
+ *
683
684
  * @__NO_SIDE_EFFECTS__
684
685
  */ function makeIsModifiedFunction(isEqualFunction) {
685
686
  return function(value) {
@@ -694,8 +695,9 @@ function _unsupported_iterable_to_array$b(o, minLen) {
694
695
  * Prefers `isModified` over `isEqual` (which is inverted), falling back to `defaultFunction`
695
696
  * or a function that always returns true.
696
697
  *
697
- * @param config - configuration with isModified, isEqual, and/or defaultFunction
698
- * @returns an observable of the resolved IsModifiedFunction
698
+ * @param config - Configuration with isModified, isEqual, and/or defaultFunction.
699
+ * @returns An observable of the resolved IsModifiedFunction.
700
+ *
699
701
  * @__NO_SIDE_EFFECTS__
700
702
  */ function makeIsModifiedFunctionObservable(config) {
701
703
  var isModified = config.isModified, isEqual = config.isEqual, defaultFunction = config.defaultFunction;
@@ -714,9 +716,10 @@ function _unsupported_iterable_to_array$b(o, minLen) {
714
716
  /**
715
717
  * Creates a function that returns the value if the check function returns true, otherwise undefined.
716
718
  *
717
- * @param isCheckFunction - optional check function
718
- * @param defaultValueOnMaybe - default result for null/undefined values
719
- * @returns a function that evaluates each value against the check function and returns it or undefined
719
+ * @param isCheckFunction - Optional check function.
720
+ * @param defaultValueOnMaybe - Default result for null/undefined values.
721
+ * @returns Function that yields the input value when it passes the check, or undefined otherwise.
722
+ *
720
723
  * @__NO_SIDE_EFFECTS__
721
724
  */ function makeReturnIfIsFunction(isCheckFunction, defaultValueOnMaybe) {
722
725
  return function(value) {
@@ -726,10 +729,10 @@ function _unsupported_iterable_to_array$b(o, minLen) {
726
729
  /**
727
730
  * Returns the value wrapped in an observable if the check function passes, otherwise emits undefined.
728
731
  *
729
- * @param isCheckFunction - optional check function
730
- * @param value - the value to check
731
- * @param defaultValueOnMaybe - default result for null/undefined values
732
- * @returns an observable that emits the value if the check passes, or undefined otherwise
732
+ * @param isCheckFunction - Optional check function.
733
+ * @param value - The value to check.
734
+ * @param defaultValueOnMaybe - Default result for null/undefined values.
735
+ * @returns An observable that emits the value if the check passes, or undefined otherwise.
733
736
  */ function returnIfIs(isCheckFunction, value, defaultValueOnMaybe) {
734
737
  return checkIs(isCheckFunction, value, defaultValueOnMaybe).pipe(rxjs.map(function(x) {
735
738
  return x ? value : undefined;
@@ -738,9 +741,10 @@ function _unsupported_iterable_to_array$b(o, minLen) {
738
741
  /**
739
742
  * Creates a function that checks a value against the check function and returns an observable boolean.
740
743
  *
741
- * @param isCheckFunction - optional check function
742
- * @param defaultValueOnMaybe - default result for null/undefined values
743
- * @returns a function that evaluates each value against the check function and returns an observable boolean
744
+ * @param isCheckFunction - Optional check function.
745
+ * @param defaultValueOnMaybe - Default result for null/undefined values.
746
+ * @returns Function that emits whether the supplied value passes the check, falling back to the default for missing values.
747
+ *
744
748
  * @__NO_SIDE_EFFECTS__
745
749
  */ function makeCheckIsFunction(isCheckFunction, defaultValueOnMaybe) {
746
750
  return function(value) {
@@ -752,10 +756,10 @@ function _unsupported_iterable_to_array$b(o, minLen) {
752
756
  *
753
757
  * Returns `of(true)` when no check function is provided.
754
758
  *
755
- * @param isCheckFunction - optional check function
756
- * @param value - the value to check
757
- * @param defaultValueOnMaybe - default result for null/undefined values (defaults to false)
758
- * @returns an observable boolean indicating whether the value passes the check
759
+ * @param isCheckFunction - Optional check function.
760
+ * @param value - The value to check.
761
+ * @param defaultValueOnMaybe - Default result for null/undefined values (defaults to false)
762
+ * @returns An observable boolean indicating whether the value passes the check.
759
763
  */ function checkIs(isCheckFunction, value) {
760
764
  var defaultValueOnMaybe = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
761
765
  var is = isCheckFunction ? value != null ? isCheckFunction(value) : rxjs.of(defaultValueOnMaybe) : rxjs.of(true);
@@ -765,7 +769,7 @@ function _unsupported_iterable_to_array$b(o, minLen) {
765
769
  /**
766
770
  * RxJS operator that filters out null and undefined values, only passing through defined values.
767
771
  *
768
- * @returns operator that filters out null and undefined emissions
772
+ * @returns Operator that filters out null and undefined emissions.
769
773
  */ function filterMaybe() {
770
774
  return rxjs.filter(util.isMaybeSo);
771
775
  }
@@ -775,14 +779,14 @@ function _unsupported_iterable_to_array$b(o, minLen) {
775
779
  /**
776
780
  * RxJS operator that filters out null/undefined elements from an emitted array, keeping only defined values.
777
781
  *
778
- * @returns operator that maps each emitted array to a version with null/undefined elements removed
782
+ * @returns Operator that maps each emitted array to a version with null/undefined elements removed.
779
783
  */ function filterMaybeArray() {
780
784
  return rxjs.map(util.filterMaybeArrayValues);
781
785
  }
782
786
  /**
783
787
  * RxJS operator that skips all leading null/undefined emissions, then passes all subsequent values through.
784
788
  *
785
- * @returns operator that skips all null/undefined emissions at the start of the stream
789
+ * @returns Operator that skips all null/undefined emissions at the start of the stream.
786
790
  */ function skipAllInitialMaybe() {
787
791
  return rxjs.skipWhile(function(x) {
788
792
  return x == null;
@@ -791,15 +795,15 @@ function _unsupported_iterable_to_array$b(o, minLen) {
791
795
  /**
792
796
  * RxJS operator that skips only the first emission if it is null/undefined, then passes all subsequent values.
793
797
  *
794
- * @returns operator that skips the first null/undefined emission if it occurs at the start of the stream
798
+ * @returns Operator that skips the first null/undefined emission if it occurs at the start of the stream.
795
799
  */ function skipInitialMaybe() {
796
800
  return skipMaybes(1);
797
801
  }
798
802
  /**
799
803
  * RxJS operator that skips up to `maxToSkip` null/undefined emissions, then passes all subsequent values.
800
804
  *
801
- * @param maxToSkip - maximum number of null/undefined emissions to skip
802
- * @returns operator that skips the first N null/undefined emissions from the stream
805
+ * @param maxToSkip - Maximum number of null/undefined emissions to skip.
806
+ * @returns Operator that skips the first N null/undefined emissions from the stream.
803
807
  */ function skipMaybes(maxToSkip) {
804
808
  return rxjs.skipWhile(function(x, i) {
805
809
  return x == null && i < maxToSkip;
@@ -808,8 +812,8 @@ function _unsupported_iterable_to_array$b(o, minLen) {
808
812
  /**
809
813
  * RxJS operator that switches to the emitted observable if defined, or emits the default value if null/undefined.
810
814
  *
811
- * @param defaultValue - fallback value when the observable is nullish (defaults to undefined)
812
- * @returns an operator that handles optional observables
815
+ * @param defaultValue - Fallback value when the observable is nullish (defaults to undefined)
816
+ * @returns An operator that handles optional observables.
813
817
  */ function switchMapMaybeDefault() {
814
818
  var defaultValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : undefined;
815
819
  return rxjs.switchMap(function(x) {
@@ -830,8 +834,8 @@ function switchMapToDefault(defaultObs, useDefault) {
830
834
  * RxJS operator that resolves an observable/getter config input into a value, applying defaults
831
835
  * for `null`/`undefined`/`true` inputs and emitting `null` for `false`.
832
836
  *
833
- * @param config - configuration providing an optional default getter for null/undefined/true inputs
834
- * @returns operator that resolves each emitted getter into a value, using the default for nullish or true inputs
837
+ * @param config - Configuration providing an optional default getter for null/undefined/true inputs.
838
+ * @returns Operator that resolves each emitted getter into a value, using the default for nullish or true inputs.
835
839
  */ function switchMapObject(config) {
836
840
  var defaultGetter = config.defaultGetter;
837
841
  return rxjs.switchMap(function(inputConfig) {
@@ -855,10 +859,13 @@ function switchMapWhileFalse(obs, otherwise) {
855
859
  }
856
860
  function switchMapOnBoolean(switchOnValue, obs, otherwise) {
857
861
  return rxjs.switchMap(function(x) {
862
+ var result;
858
863
  if (x === switchOnValue) {
859
- return asObservableFromGetter(obs);
864
+ result = asObservableFromGetter(obs);
865
+ } else {
866
+ result = otherwise == null ? rxjs.EMPTY : asObservableFromGetter(otherwise);
860
867
  }
861
- return otherwise == null ? rxjs.EMPTY : asObservableFromGetter(otherwise);
868
+ return result;
862
869
  });
863
870
  }
864
871
  /**
@@ -866,7 +873,7 @@ function switchMapOnBoolean(switchOnValue, obs, otherwise) {
866
873
  *
867
874
  * Combines {@link filterMaybe} and `switchMap` to only subscribe to non-nullish observables.
868
875
  *
869
- * @returns operator that filters nullish observables and subscribes to the non-nullish ones
876
+ * @returns Operator that filters nullish observables and subscribes to the non-nullish ones.
870
877
  */ function switchMapFilterMaybe() {
871
878
  return function(source) {
872
879
  var subscriber = source.pipe(filterMaybe(), rxjs.switchMap(function(x) {
@@ -878,7 +885,7 @@ function switchMapOnBoolean(switchOnValue, obs, otherwise) {
878
885
  /**
879
886
  * RxJS operator that switches to the emitted observable if defined, or emits `undefined` when the observable is nullish.
880
887
  *
881
- * @returns operator that switches to the emitted observable or emits undefined for null/undefined inputs
888
+ * @returns Operator that switches to the emitted observable or emits undefined for null/undefined inputs.
882
889
  */ function switchMapMaybe() {
883
890
  return function(source) {
884
891
  var subscriber = source.pipe(rxjs.switchMap(function(x) {
@@ -890,17 +897,17 @@ function switchMapOnBoolean(switchOnValue, obs, otherwise) {
890
897
  /**
891
898
  * RxJS operator that applies a map function only when the emitted value is non-null/non-undefined.
892
899
  *
893
- * @param mapFn - function to transform defined values
894
- * @returns an operator that maps defined values and passes through undefined
900
+ * @param mapFn - Function to transform defined values.
901
+ * @returns An operator that maps defined values and passes through undefined.
895
902
  */ function mapMaybe(mapFn) {
896
903
  return mapIf(mapFn, util.isMaybeSo);
897
904
  }
898
905
  /**
899
906
  * RxJS operator that applies a map function only when the decision function returns true.
900
907
  *
901
- * @param mapFn - function to transform the value
902
- * @param decision - predicate that determines whether to apply the map
903
- * @returns an operator that conditionally maps values
908
+ * @param mapFn - Function to transform the value.
909
+ * @param decision - Predicate that determines whether to apply the map.
910
+ * @returns An operator that conditionally maps values.
904
911
  */ function mapIf(mapFn, decision) {
905
912
  return rxjs.map(function(x) {
906
913
  return decision(x) ? mapFn(x) : undefined;
@@ -909,9 +916,9 @@ function switchMapOnBoolean(switchOnValue, obs, otherwise) {
909
916
  /**
910
917
  * Combines the source observable with another observable via `combineLatest`, then maps the pair to a result.
911
918
  *
912
- * @param combineObs - the secondary observable to combine with the source
913
- * @param mapFn - function that maps the source value and combined value to the output
914
- * @returns operator that combines the source with `combineObs` and maps each pair using `mapFn`
919
+ * @param combineObs - The secondary observable to combine with the source.
920
+ * @param mapFn - Function that maps the source value and combined value to the output.
921
+ * @returns Operator that combines the source with `combineObs` and maps each pair using `mapFn`
915
922
  */ function combineLatestMapFrom(combineObs, mapFn) {
916
923
  return function(obs) {
917
924
  return rxjs.combineLatest([
@@ -928,10 +935,10 @@ function switchMapOnBoolean(switchOnValue, obs, otherwise) {
928
935
  *
929
936
  * If the delay is not provided, or is falsy, then the second value is never emitted.
930
937
  *
931
- * @param startWith - the value to emit immediately
932
- * @param endWith - the value to emit after the delay
933
- * @param delayTime - optional delay in milliseconds before emitting the second value
934
- * @returns an observable that emits `startWith` immediately and `endWith` after the delay (if provided)
938
+ * @param startWith - The value to emit immediately.
939
+ * @param endWith - The value to emit after the delay.
940
+ * @param delayTime - Optional delay in milliseconds before emitting the second value.
941
+ * @returns An observable that emits `startWith` immediately and `endWith` after the delay (if provided)
935
942
  */ function emitDelayObs(startWith, endWith, delayTime) {
936
943
  var obs = rxjs.of(startWith);
937
944
  if (delayTime) {
@@ -942,9 +949,9 @@ function switchMapOnBoolean(switchOnValue, obs, otherwise) {
942
949
  /**
943
950
  * Emits a value after a given delay after every new emission.
944
951
  *
945
- * @param value - the value to emit after the delay
946
- * @param delayTime - duration in milliseconds before emitting the value
947
- * @returns operator that appends the given value after each source emission with the specified delay
952
+ * @param value - The value to emit after the delay.
953
+ * @param delayTime - Duration in milliseconds before emitting the value.
954
+ * @returns Operator that appends the given value after each source emission with the specified delay.
948
955
  */ function emitAfterDelay(value, delayTime) {
949
956
  return function(obs) {
950
957
  return obs.pipe(rxjs.switchMap(function(x) {
@@ -959,7 +966,7 @@ function switchMapOnBoolean(switchOnValue, obs, otherwise) {
959
966
  * Uses {@link areEqualPOJOValues} for comparison, so the emitted objects should be plain objects
960
967
  * or compatible with deep value equality checks.
961
968
  *
962
- * @returns operator that filters out consecutive duplicate POJO emissions
969
+ * @returns Operator that filters out consecutive duplicate POJO emissions.
963
970
  *
964
971
  * @example
965
972
  * ```ts
@@ -1069,7 +1076,7 @@ function _unsupported_iterable_to_array$a(o, minLen) {
1069
1076
  get: /**
1070
1077
  * Whether a subscription is currently being managed.
1071
1078
  *
1072
- * @returns true if a subscription is currently active
1079
+ * @returns True if a subscription is currently active.
1073
1080
  */ function get() {
1074
1081
  return Boolean(this._subscription);
1075
1082
  }
@@ -1086,7 +1093,7 @@ function _unsupported_iterable_to_array$a(o, minLen) {
1086
1093
  /**
1087
1094
  * Replaces the current subscription with the given one, unsubscribing from the previous.
1088
1095
  *
1089
- * @param sub - new subscription to manage, or `undefined`/`void` to just unsubscribe
1096
+ * @param sub - New subscription to manage, or `undefined`/`void` to just unsubscribe.
1090
1097
  */ key: "setSub",
1091
1098
  value: function setSub(sub) {
1092
1099
  this.unsub();
@@ -1150,7 +1157,7 @@ function _unsupported_iterable_to_array$a(o, minLen) {
1150
1157
  get: /**
1151
1158
  * Whether any subscriptions are currently being managed.
1152
1159
  *
1153
- * @returns true if one or more subscriptions are currently active
1160
+ * @returns True if one or more subscriptions are currently active.
1154
1161
  */ function get() {
1155
1162
  var _this__subscriptions;
1156
1163
  return Boolean((_this__subscriptions = this._subscriptions) === null || _this__subscriptions === void 0 ? void 0 : _this__subscriptions.length);
@@ -1168,7 +1175,7 @@ function _unsupported_iterable_to_array$a(o, minLen) {
1168
1175
  /**
1169
1176
  * Replaces all managed subscriptions with the given ones, unsubscribing from all previous.
1170
1177
  *
1171
- * @param subs - new subscription(s) to manage
1178
+ * @param subs - New subscription(s) to manage.
1172
1179
  */ key: "setSubs",
1173
1180
  value: function setSubs(subs) {
1174
1181
  this.unsub();
@@ -1179,7 +1186,7 @@ function _unsupported_iterable_to_array$a(o, minLen) {
1179
1186
  /**
1180
1187
  * Adds subscription(s) to the managed set without affecting existing ones. Duplicate subscriptions are ignored.
1181
1188
  *
1182
- * @param subs - subscription(s) to add
1189
+ * @param subs - Subscription(s) to add.
1183
1190
  */ key: "addSubs",
1184
1191
  value: function addSubs(subs) {
1185
1192
  var _this__subscriptions;
@@ -1362,7 +1369,7 @@ function _unsupported_iterable_to_array$9(o, minLen) {
1362
1369
  /**
1363
1370
  * Sets an initial filter observable that takes priority over the default filter.
1364
1371
  *
1365
- * @param filterObs - observable providing the initial filter value
1372
+ * @param filterObs - Observable providing the initial filter value.
1366
1373
  */ key: "initWithFilter",
1367
1374
  value: function initWithFilter(filterObs) {
1368
1375
  this._initialFilter.next(filterObs);
@@ -1373,7 +1380,7 @@ function _unsupported_iterable_to_array$9(o, minLen) {
1373
1380
  /**
1374
1381
  * Sets the default filter, used as a fallback when no explicit or initial filter is active.
1375
1382
  *
1376
- * @param filter - default filter value, observable, or undefined to clear
1383
+ * @param filter - Default filter value, observable, or undefined to clear.
1377
1384
  */ key: "setDefaultFilter",
1378
1385
  value: function setDefaultFilter(filter) {
1379
1386
  this._defaultFilter.next(asObservable(filter));
@@ -1383,7 +1390,7 @@ function _unsupported_iterable_to_array$9(o, minLen) {
1383
1390
  /**
1384
1391
  * Sets an explicit filter value that takes priority over the initial and default filters.
1385
1392
  *
1386
- * @param filter - the filter value to set
1393
+ * @param filter - The filter value to set.
1387
1394
  */ key: "setFilter",
1388
1395
  value: function setFilter(filter) {
1389
1396
  this._filter.next(filter);
@@ -1404,7 +1411,7 @@ function _unsupported_iterable_to_array$9(o, minLen) {
1404
1411
  * When enabled, any new emission from the initial filter observable clears the explicit
1405
1412
  * filter, causing `filter$` to fall back to the initial filter value.
1406
1413
  *
1407
- * @param initialFilterTakesPriority - whether initial filter changes should reset the explicit filter
1414
+ * @param initialFilterTakesPriority - Whether initial filter changes should reset the explicit filter.
1408
1415
  */ key: "setInitialFilterTakesPriority",
1409
1416
  value: function setInitialFilterTakesPriority(initialFilterTakesPriority) {
1410
1417
  this._initialFilterTakesPriority.next(initialFilterTakesPriority);
@@ -1418,15 +1425,18 @@ function _unsupported_iterable_to_array$9(o, minLen) {
1418
1425
  var _this = this;
1419
1426
  var _this__initialFilterSub, _subscription;
1420
1427
  (_subscription = (_this__initialFilterSub = this._initialFilterSub).subscription) !== null && _subscription !== void 0 ? _subscription : _this__initialFilterSub.subscription = this._initialFilterTakesPriority.pipe(rxjs.switchMap(function(clearFilterOnInitialFilterPush) {
1428
+ var result;
1421
1429
  if (clearFilterOnInitialFilterPush) {
1422
- return _this._initialFilter.pipe(rxjs.switchMap(function(x) {
1430
+ result = _this._initialFilter.pipe(rxjs.switchMap(function(x) {
1423
1431
  return x !== null && x !== void 0 ? x : rxjs.EMPTY;
1424
1432
  }), filterMaybe(), rxjs.map(function() {
1425
1433
  return true;
1426
1434
  }), rxjs.skip(1) // skip the first emission
1427
1435
  );
1436
+ } else {
1437
+ result = rxjs.EMPTY;
1428
1438
  }
1429
- return rxjs.EMPTY;
1439
+ return result;
1430
1440
  }), rxjs.defaultIfEmpty(false)).subscribe(function(clear) {
1431
1441
  if (clear) {
1432
1442
  _this.resetFilter();
@@ -1536,8 +1546,8 @@ function _unsupported_iterable_to_array$8(o, minLen) {
1536
1546
  *
1537
1547
  * Waits until a filter entry exists for the key, then switches to its filter stream.
1538
1548
  *
1539
- * @param key - filter map key to observe
1540
- * @returns observable that emits the current filter value for the key
1549
+ * @param key - Filter map key to observe.
1550
+ * @returns Observable that emits the current filter value for the key.
1541
1551
  */ key: "filterForKey",
1542
1552
  value: function filterForKey(key) {
1543
1553
  return this._map.pipe(rxjs.map(function(x) {
@@ -1551,8 +1561,8 @@ function _unsupported_iterable_to_array$8(o, minLen) {
1551
1561
  /**
1552
1562
  * Sets a default filter observable for the given key, used as a fallback when no explicit filter is set.
1553
1563
  *
1554
- * @param key - filter map key
1555
- * @param obs - default filter observable or value
1564
+ * @param key - Filter map key.
1565
+ * @param obs - Default filter observable or value.
1556
1566
  */ key: "addDefaultFilterObs",
1557
1567
  value: function addDefaultFilterObs(key, obs) {
1558
1568
  this._itemForKey(key).setDefaultFilterObs(obs);
@@ -1563,8 +1573,8 @@ function _unsupported_iterable_to_array$8(o, minLen) {
1563
1573
  * Adds a filter observable for the given key. Multiple observables can be added per key
1564
1574
  * and their emissions are merged together.
1565
1575
  *
1566
- * @param key - filter map key
1567
- * @param obs - filter observable to add
1576
+ * @param key - Filter map key.
1577
+ * @param obs - Filter observable to add.
1568
1578
  */ key: "addFilterObs",
1569
1579
  value: function addFilterObs(key, obs) {
1570
1580
  this._itemForKey(key).addFilterObs(obs);
@@ -1575,8 +1585,8 @@ function _unsupported_iterable_to_array$8(o, minLen) {
1575
1585
  * Creates a {@link FilterMapKeyInstance} bound to the given key, providing both
1576
1586
  * {@link FilterSource} and {@link FilterSourceConnector} interfaces for that key.
1577
1587
  *
1578
- * @param key - filter map key to bind
1579
- * @returns instance for interacting with the filter at the given key
1588
+ * @param key - Filter map key to bind.
1589
+ * @returns Instance for interacting with the filter at the given key.
1580
1590
  */ key: "makeInstance",
1581
1591
  value: function makeInstance(key) {
1582
1592
  return new FilterMapKeyInstance(this, key);
@@ -1586,8 +1596,8 @@ function _unsupported_iterable_to_array$8(o, minLen) {
1586
1596
  /**
1587
1597
  * Creates an observable that emits a new {@link FilterMapKeyInstance} each time the key changes.
1588
1598
  *
1589
- * @param keyObs - observable of filter map keys
1590
- * @returns observable that emits instances for the current key
1599
+ * @param keyObs - Observable of filter map keys.
1600
+ * @returns Observable that emits instances for the current key.
1591
1601
  */ key: "instanceObsForKeyObs",
1592
1602
  value: function instanceObsForKeyObs(keyObs) {
1593
1603
  var _this = this;
@@ -1657,7 +1667,7 @@ function _unsupported_iterable_to_array$8(o, minLen) {
1657
1667
  /**
1658
1668
  * Sets the default filter observable for this key.
1659
1669
  *
1660
- * @param filterObs - the observable to use as the default filter for this key
1670
+ * @param filterObs - The observable to use as the default filter for this key.
1661
1671
  */ key: "initWithFilter",
1662
1672
  value: function initWithFilter(filterObs) {
1663
1673
  this.dbxFilterMap.addDefaultFilterObs(this.key, filterObs);
@@ -1667,7 +1677,7 @@ function _unsupported_iterable_to_array$8(o, minLen) {
1667
1677
  /**
1668
1678
  * Connects a filter source, adding its filter observable to this key's merged filters.
1669
1679
  *
1670
- * @param filterSource - the filter source whose filter$ will be added to this key's merged stream
1680
+ * @param filterSource - The filter source whose filter$ will be added to this key's merged stream.
1671
1681
  */ key: "connectWithSource",
1672
1682
  value: function connectWithSource(filterSource) {
1673
1683
  this.dbxFilterMap.addFilterObs(this.key, filterSource.filter$);
@@ -1776,8 +1786,8 @@ var FilterMapItem = /*#__PURE__*/ function() {
1776
1786
  * into concrete filter values, then the `preset` field is removed from the result.
1777
1787
  * Filters without a preset are passed through unchanged.
1778
1788
  *
1779
- * @param fn - function that expands a preset into concrete filter values
1780
- * @returns mapping function that resolves presets and strips the preset field
1789
+ * @param fn - Function that expands a preset into concrete filter values.
1790
+ * @returns Mapping function that resolves presets and strips the preset field.
1781
1791
  *
1782
1792
  * @example
1783
1793
  * ```ts
@@ -1793,22 +1803,26 @@ var FilterMapItem = /*#__PURE__*/ function() {
1793
1803
  * const result = resolve({ preset: 'active' });
1794
1804
  * // result === { active: true }
1795
1805
  * ```
1806
+ *
1796
1807
  * @__NO_SIDE_EFFECTS__
1797
1808
  */ function makeMapFilterWithPresetFn(fn) {
1798
1809
  return function(filter) {
1810
+ var result;
1799
1811
  if (filter.preset) {
1800
- var result = fn(filter);
1801
- delete result.preset;
1802
- return result;
1812
+ var expanded = fn(filter);
1813
+ delete expanded.preset;
1814
+ result = expanded;
1815
+ } else {
1816
+ result = filter;
1803
1817
  }
1804
- return filter;
1818
+ return result;
1805
1819
  };
1806
1820
  }
1807
1821
  /**
1808
1822
  * RxJS operator that resolves preset references in a filter stream using the provided mapping function.
1809
1823
  *
1810
- * @param fn - function that expands a preset into concrete filter values
1811
- * @returns operator that maps filter emissions, resolving any preset references
1824
+ * @param fn - Function that expands a preset into concrete filter values.
1825
+ * @returns Operator that maps filter emissions, resolving any preset references.
1812
1826
  */ function mapFilterWithPreset(fn) {
1813
1827
  return rxjs.map(makeMapFilterWithPresetFn(fn));
1814
1828
  }
@@ -2033,8 +2047,8 @@ function _ts_generator$1(thisArg, body) {
2033
2047
  * Combines an iteration's `hasNext$` and `canLoadMore$` into a single observable that emits
2034
2048
  * `true` only when both conditions are met (more items exist and the page limit hasn't been reached).
2035
2049
  *
2036
- * @param iteration - the iteration to check
2037
- * @returns observable that emits `true` when more items can be loaded
2050
+ * @param iteration - The iteration to check.
2051
+ * @returns Observable that emits `true` when more items can be loaded.
2038
2052
  */ function iterationHasNextAndCanLoadMore(iteration) {
2039
2053
  return iteration.canLoadMore$.pipe(rxjs.switchMap(function(canLoadMore) {
2040
2054
  return canLoadMore ? iteration.hasNext$ : rxjs.of(false);
@@ -2045,12 +2059,11 @@ function _ts_generator$1(thisArg, body) {
2045
2059
  *
2046
2060
  * Falls back to the provided default limit if no max is configured on the iterator.
2047
2061
  *
2048
- * @param iterator - the page iteration to advance
2049
- * @param defaultLimit - fallback page limit if none is configured (defaults to 100)
2050
- * @returns promise resolving to the last loaded page number
2051
- *
2052
- * @throws {Error} If neither a max page load limit nor a default limit is defined
2053
- * @throws Rejects if the iteration encounters a loading error
2062
+ * @param iterator - The page iteration to advance.
2063
+ * @param defaultLimit - Fallback page limit if none is configured (defaults to 100)
2064
+ * @returns Promise resolving to the last loaded page number.
2065
+ * @throws {Error} If neither a max page load limit nor a default limit is defined.
2066
+ * @throws {Error} Rejects if the iteration encounters a loading error.
2054
2067
  */ function iteratorNextPageUntilMaxPageLoadLimit(iterator) {
2055
2068
  var defaultLimit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 100;
2056
2069
  return iteratorNextPageUntilPage(iterator, function() {
@@ -2066,11 +2079,10 @@ function _ts_generator$1(thisArg, body) {
2066
2079
  * Automatically pages through a {@link PageItemIteration} until the specified page number is reached,
2067
2080
  * respecting the iteration's max page load limit.
2068
2081
  *
2069
- * @param iteration - the page iteration to advance
2070
- * @param page - target page number (or getter returning one) representing total pages to load
2071
- * @returns promise resolving to the last loaded page number
2072
- *
2073
- * @throws Rejects if the iteration encounters a loading error
2082
+ * @param iteration - The page iteration to advance.
2083
+ * @param page - Target page number (or getter returning one) representing total pages to load.
2084
+ * @returns Promise resolving to the last loaded page number.
2085
+ * @throws {Error} Rejects if the iteration encounters a loading error.
2074
2086
  */ function iteratorNextPageUntilPage(iteration, page) {
2075
2087
  var getPageLimit = util.asGetter(page);
2076
2088
  function checkPageLimit(page) {
@@ -2172,8 +2184,8 @@ function scanIntoArray() {
2172
2184
  * are incrementally appended. Useful when loading large datasets where the initial page and
2173
2185
  * subsequent pages come from different sources.
2174
2186
  *
2175
- * @param init - function that receives the seed state and returns the accumulator config
2176
- * @returns an operator that emits the growing array
2187
+ * @param init - Function that receives the seed state and returns the accumulator config.
2188
+ * @returns An operator that emits the growing array.
2177
2189
  */ function scanBuildArray(init) {
2178
2190
  return rxjs.exhaustMap(function(seedState) {
2179
2191
  var _init = init(seedState), _init_seed = _init.seed, seed = _init_seed === void 0 ? [] : _init_seed, accumulatorObs = _init.accumulatorObs, _init_flattenArray = _init.flattenArray, flattenArray = _init_flattenArray === void 0 ? false : _init_flattenArray;
@@ -2195,8 +2207,8 @@ function scanIntoArray() {
2195
2207
  /**
2196
2208
  * RxJS operator that executes a side-effect on each element of the emitted array, then passes the array through.
2197
2209
  *
2198
- * @param forEach - callback to run for each element, or null/undefined to pass through unchanged
2199
- * @returns an operator that taps each element in emitted arrays
2210
+ * @param forEach - Callback to run for each element, or null/undefined to pass through unchanged.
2211
+ * @returns An operator that taps each element in emitted arrays.
2200
2212
  */ function mapForEach(forEach) {
2201
2213
  return forEach ? rxjs.map(function(x) {
2202
2214
  return util.forEachWithArray(x, forEach);
@@ -2210,21 +2222,24 @@ function scanIntoArray() {
2210
2222
  *
2211
2223
  * Emits `[]` for empty arrays. When `onlyFirst` is true, takes only the first combined emission.
2212
2224
  *
2213
- * @param mapFunction - function that maps each item to an ObservableInput
2214
- * @param config - optional config (e.g., `onlyFirst`)
2215
- * @returns an operator that async-maps each array element
2225
+ * @param mapFunction - Function that maps each item to an ObservableInput.
2226
+ * @param config - Optional config (e.g., `onlyFirst`)
2227
+ * @returns An operator that async-maps each array element.
2216
2228
  */ function mapEachAsync(mapFunction, config) {
2217
2229
  var _ref = config !== null && config !== void 0 ? config : {}, _ref_onlyFirst = _ref.onlyFirst, onlyFirst = _ref_onlyFirst === void 0 ? false : _ref_onlyFirst;
2218
2230
  return rxjs.switchMap(function(values) {
2231
+ var result;
2219
2232
  if (values.length) {
2220
2233
  var mappedObs = values.map(mapFunction);
2221
- var result = rxjs.combineLatest(mappedObs);
2234
+ var combined = rxjs.combineLatest(mappedObs);
2222
2235
  if (onlyFirst) {
2223
- result = result.pipe(rxjs.first());
2236
+ combined = combined.pipe(rxjs.first());
2224
2237
  }
2225
- return result;
2238
+ result = combined;
2239
+ } else {
2240
+ result = rxjs.of([]);
2226
2241
  }
2227
- return rxjs.of([]);
2242
+ return result;
2228
2243
  });
2229
2244
  }
2230
2245
 
@@ -2234,6 +2249,9 @@ function scanIntoArray() {
2234
2249
  * The `from` value must be seen first; only then is the `to` value emitted. When `requireConsecutive`
2235
2250
  * is true, the two values must be adjacent emissions.
2236
2251
  *
2252
+ * @param config - From/to values, optional comparator, and consecutive requirement.
2253
+ * @returns An operator that emits on value transitions.
2254
+ *
2237
2255
  * @example
2238
2256
  * ```ts
2239
2257
  * // Emit when transitioning from true to false
@@ -2241,9 +2259,6 @@ function scanIntoArray() {
2241
2259
  * onMatchDelta({ from: true, to: false, requireConsecutive: true })
2242
2260
  * ).subscribe((val) => console.log('Transitioned to false'));
2243
2261
  * ```
2244
- *
2245
- * @param config - from/to values, optional comparator, and consecutive requirement
2246
- * @returns an operator that emits on value transitions
2247
2262
  */ function onMatchDelta(config) {
2248
2263
  var inputIsSame = config.isMatch, from = config.from, to = config.to, requireConsecutive = config.requireConsecutive;
2249
2264
  var isMatch = inputIsSame !== null && inputIsSame !== void 0 ? inputIsSame : function(a, b) {
@@ -2302,16 +2317,16 @@ function scanIntoArray() {
2302
2317
  /**
2303
2318
  * Conditionally applies an operator. Returns the given pipe when `usePipe` is true, otherwise returns identity (pass-through).
2304
2319
  *
2305
- * @param usePipe - whether to apply the pipe
2306
- * @param pipe - the operator to conditionally apply
2307
- * @returns the pipe or identity operator
2320
+ * @param usePipe - Whether to apply the pipe.
2321
+ * @param pipe - The operator to conditionally apply.
2322
+ * @returns The pipe or identity operator.
2308
2323
  */ function pipeIf(usePipe, pipe) {
2309
2324
  return usePipe ? pipe : rxjs.identity;
2310
2325
  }
2311
2326
  /**
2312
2327
  * RxJS operator that negates each emitted boolean value.
2313
2328
  *
2314
- * @returns operator that maps each boolean emission to its negated value
2329
+ * @returns Operator that maps each boolean emission to its negated value.
2315
2330
  */ function isNot() {
2316
2331
  return rxjs.map(function(x) {
2317
2332
  return !x;
@@ -2320,7 +2335,7 @@ function scanIntoArray() {
2320
2335
  /**
2321
2336
  * RxJS operator that only emits when a boolean stream transitions from `true` to `false`.
2322
2337
  *
2323
- * @returns operator that filters to only true-to-false transition emissions
2338
+ * @returns Operator that filters to only true-to-false transition emissions.
2324
2339
  */ function onTrueToFalse() {
2325
2340
  return onMatchDelta({
2326
2341
  from: true,
@@ -2331,7 +2346,7 @@ function scanIntoArray() {
2331
2346
  /**
2332
2347
  * RxJS operator that only emits when a boolean stream transitions from `false` to `true`.
2333
2348
  *
2334
- * @returns operator that filters to only false-to-true transition emissions
2349
+ * @returns Operator that filters to only false-to-true transition emissions.
2335
2350
  */ function onFalseToTrue() {
2336
2351
  return onMatchDelta({
2337
2352
  from: false,
@@ -2345,9 +2360,9 @@ function scanIntoArray() {
2345
2360
  *
2346
2361
  * When `invert` is false, returns the original function unchanged.
2347
2362
  *
2348
- * @param decisionFn - the decision function to invert
2349
- * @param invert - whether to apply the inversion (defaults to true)
2350
- * @returns the inverted (or original) decision function
2363
+ * @param decisionFn - The decision function to invert.
2364
+ * @param invert - Whether to apply the inversion (defaults to true)
2365
+ * @returns The inverted (or original) decision function.
2351
2366
  */ function invertObservableDecision(decisionFn) {
2352
2367
  var invert = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
2353
2368
  return invert ? function(value) {
@@ -2363,9 +2378,9 @@ function scanIntoArray() {
2363
2378
  * Items where the decision returns true are kept; others are removed. Results are throttled
2364
2379
  * to prevent excessive re-emissions.
2365
2380
  *
2366
- * @param observableDecisionFunction - async predicate to evaluate each item
2367
- * @param throttle - throttle duration in ms (defaults to 20)
2368
- * @returns an operator that async-filters array elements
2381
+ * @param observableDecisionFunction - Async predicate to evaluate each item.
2382
+ * @param throttle - Throttle duration in ms (defaults to 20)
2383
+ * @returns An operator that async-filters array elements.
2369
2384
  */ function filterItemsWithObservableDecision(observableDecisionFunction) {
2370
2385
  var throttle = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 20;
2371
2386
  var filterAndMap = util.filterAndMapFunction(function(x) {
@@ -2399,8 +2414,8 @@ function scanIntoArray() {
2399
2414
  * RxJS operator that maps each emission to a new {@link Expires} object with an expiration
2400
2415
  * time relative to the current moment.
2401
2416
  *
2402
- * @param expiresIn - duration in milliseconds until expiration
2403
- * @returns an `OperatorFunction` that maps each emission to an {@link Expires} object
2417
+ * @param expiresIn - Duration in milliseconds until expiration.
2418
+ * @returns An `OperatorFunction` that maps each emission to an {@link Expires} object.
2404
2419
  */ function toExpiration(expiresIn) {
2405
2420
  return rxjs.map(function() {
2406
2421
  var now = new Date();
@@ -2416,7 +2431,7 @@ function scanIntoArray() {
2416
2431
  /**
2417
2432
  * RxJS operator that filters out emissions whose {@link Expires} value has already expired.
2418
2433
  *
2419
- * @returns operator that only passes through non-expired emissions
2434
+ * @returns Operator that only passes through non-expired emissions.
2420
2435
  */ function skipExpired() {
2421
2436
  return rxjs.filter(function(expires) {
2422
2437
  return !util.expirationDetails({
@@ -2427,8 +2442,8 @@ function scanIntoArray() {
2427
2442
  /**
2428
2443
  * RxJS operator that skips emissions until the elapsed time since the emitted date/timestamp has exceeded `expiresIn`.
2429
2444
  *
2430
- * @param expiresIn - duration in milliseconds
2431
- * @returns operator that skips emissions until the time window has elapsed
2445
+ * @param expiresIn - Duration in milliseconds.
2446
+ * @returns Operator that skips emissions until the time window has elapsed.
2432
2447
  */ function skipUntilExpiration(expiresIn) {
2433
2448
  return rxjs.filter(function(x) {
2434
2449
  return util.expirationDetails({
@@ -2440,8 +2455,8 @@ function scanIntoArray() {
2440
2455
  /**
2441
2456
  * RxJS operator that skips emissions after the elapsed time since the emitted date/timestamp has exceeded `expiresIn`.
2442
2457
  *
2443
- * @param expiresIn - duration in milliseconds
2444
- * @returns operator that passes through emissions only within the time window
2458
+ * @param expiresIn - Duration in milliseconds.
2459
+ * @returns Operator that passes through emissions only within the time window.
2445
2460
  */ function skipAfterExpiration(expiresIn) {
2446
2461
  return rxjs.filter(function(x) {
2447
2462
  return !util.expirationDetails({
@@ -2453,9 +2468,9 @@ function scanIntoArray() {
2453
2468
  /**
2454
2469
  * RxJS operator that only takes emissions from the source within a time window after each emission from a watch observable.
2455
2470
  *
2456
- * @param watch - observable whose emissions reset the time window
2457
- * @param takeFor - duration in milliseconds of each time window
2458
- * @returns operator that limits source emissions to the active time window after each watch emission
2471
+ * @param watch - Observable whose emissions reset the time window.
2472
+ * @param takeFor - Duration in milliseconds of each time window.
2473
+ * @returns Operator that limits source emissions to the active time window after each watch emission.
2459
2474
  */ function skipUntilTimeElapsedAfterLastEmission(watch, takeFor) {
2460
2475
  return function(observable) {
2461
2476
  return watch.pipe(rxjs.switchMap(function() {
@@ -2473,9 +2488,9 @@ function scanIntoArray() {
2473
2488
  * RxJS operator that skips emissions from the source for a duration after each emission from a watch observable,
2474
2489
  * then passes values through once the time has elapsed.
2475
2490
  *
2476
- * @param watch - observable whose emissions reset the skip window
2477
- * @param skipFor - duration in milliseconds to skip after each watch emission
2478
- * @returns an operator that delays passing values through until time has elapsed since the last watch emission
2491
+ * @param watch - Observable whose emissions reset the skip window.
2492
+ * @param skipFor - Duration in milliseconds to skip after each watch emission.
2493
+ * @returns An operator that delays passing values through until time has elapsed since the last watch emission.
2479
2494
  */ function takeAfterTimeElapsedSinceLastEmission(watch, skipFor) {
2480
2495
  return function(observable) {
2481
2496
  return watch.pipe(rxjs.switchMap(function() {
@@ -2495,9 +2510,9 @@ function scanIntoArray() {
2495
2510
  *
2496
2511
  * After the timeout, the default value is prepended and the source continues normally.
2497
2512
  *
2498
- * @param defaultValue - value or getter to use as the default
2499
- * @param first - timeout in ms before emitting the default (defaults to 0)
2500
- * @returns an operator that provides a fallback on slow emissions
2513
+ * @param defaultValue - Value or getter to use as the default.
2514
+ * @param first - Timeout in ms before emitting the default (defaults to 0)
2515
+ * @returns An operator that provides a fallback on slow emissions.
2501
2516
  */ function timeoutStartWith(defaultValue) {
2502
2517
  var first = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
2503
2518
  return function(source) {
@@ -2512,9 +2527,9 @@ function scanIntoArray() {
2512
2527
  /**
2513
2528
  * RxJS operator that executes a side-effect function if the source does not emit within the given timeout.
2514
2529
  *
2515
- * @param timeoutDelay - timeout in ms before triggering the side-effect
2516
- * @param useFn - side-effect function to call on timeout
2517
- * @returns an operator that taps after timeout
2530
+ * @param timeoutDelay - Timeout in ms before triggering the side-effect.
2531
+ * @param useFn - Side-effect function to call on timeout.
2532
+ * @returns An operator that taps after timeout.
2518
2533
  */ function tapAfterTimeout(timeoutDelay, useFn) {
2519
2534
  return rxjs.timeout({
2520
2535
  first: timeoutDelay,
@@ -2526,9 +2541,9 @@ function scanIntoArray() {
2526
2541
  /**
2527
2542
  * RxJS operator that throws an error if the source does not emit within the given timeout.
2528
2543
  *
2529
- * @param timeoutDelay - timeout in ms before throwing
2530
- * @param error - getter that produces the error to throw
2531
- * @returns an operator that throws on timeout
2544
+ * @param timeoutDelay - Timeout in ms before throwing.
2545
+ * @param error - Getter that produces the error to throw.
2546
+ * @returns An operator that throws on timeout.
2532
2547
  */ function throwErrorAfterTimeout(timeoutDelay, error) {
2533
2548
  return rxjs.timeout({
2534
2549
  first: timeoutDelay,
@@ -2547,6 +2562,9 @@ var DEFAULT_FACTORY_TIMER_INTERVAL = 1000;
2547
2562
  * Wraps `timer()` internally and maps each tick index through the factory. Optionally limits
2548
2563
  * the total number of emissions.
2549
2564
  *
2565
+ * @param config - Timer configuration including factory, interval, wait, and limit.
2566
+ * @returns An observable of factory-produced values.
2567
+ *
2550
2568
  * @example
2551
2569
  * ```ts
2552
2570
  * const countdown$ = factoryTimer({
@@ -2556,9 +2574,6 @@ var DEFAULT_FACTORY_TIMER_INTERVAL = 1000;
2556
2574
  * });
2557
2575
  * // emits 10, 9, 8, ... 0
2558
2576
  * ```
2559
- *
2560
- * @param config - timer configuration including factory, interval, wait, and limit
2561
- * @returns an observable of factory-produced values
2562
2577
  */ function factoryTimer(config) {
2563
2578
  var _config_wait = config.wait, wait = _config_wait === void 0 ? 0 : _config_wait, _config_interval = config.interval, interval = _config_interval === void 0 ? DEFAULT_FACTORY_TIMER_INTERVAL : _config_interval, limit = config.limit, factory = config.factory;
2564
2579
  var obs = rxjs.timer(wait, interval);
@@ -2576,16 +2591,16 @@ var DEFAULT_FACTORY_TIMER_INTERVAL = 1000;
2576
2591
  * `distinctUntilChanged` variant for arrays that only emits when the set of keys extracted from
2577
2592
  * the array elements changes.
2578
2593
  *
2579
- * @param readKey - function to extract one or more keys from each element
2580
- * @returns an operator that filters out arrays with unchanged key sets
2594
+ * @param readKey - Function to extract one or more keys from each element.
2595
+ * @returns An operator that filters out arrays with unchanged key sets.
2581
2596
  */ function distinctUntilKeysChange(readKey) {
2582
2597
  return rxjs.distinctUntilChanged(util.objectKeysEqualityComparatorFunction(readKey));
2583
2598
  }
2584
2599
  /**
2585
2600
  * `distinctUntilChanged` variant for single objects that only emits when the extracted key changes.
2586
2601
  *
2587
- * @param readKey - function to extract a key from the emitted object
2588
- * @returns an operator that filters out emissions with unchanged keys
2602
+ * @param readKey - Function to extract a key from the emitted object.
2603
+ * @returns An operator that filters out emissions with unchanged keys.
2589
2604
  */ function distinctUntilObjectKeyChange(readKey) {
2590
2605
  return rxjs.distinctUntilChanged(util.objectKeyEqualityComparatorFunction(readKey));
2591
2606
  }
@@ -2597,9 +2612,9 @@ var DEFAULT_FACTORY_TIMER_INTERVAL = 1000;
2597
2612
  * delays emitting the new value until the previous destruction completes.
2598
2613
  * On unsubscription, the last emitted instance is also destroyed.
2599
2614
  *
2600
- * @param destroy - function to clean up each replaced instance
2601
- * @param wait - whether to wait for the previous destroy to complete before emitting
2602
- * @returns an operator that manages instance lifecycle
2615
+ * @param destroy - Function to clean up each replaced instance.
2616
+ * @param wait - Whether to wait for the previous destroy to complete before emitting.
2617
+ * @returns An operator that manages instance lifecycle.
2603
2618
  */ function cleanup(destroy) {
2604
2619
  var wait = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
2605
2620
  return function(obs) {
@@ -2638,8 +2653,8 @@ var DEFAULT_FACTORY_TIMER_INTERVAL = 1000;
2638
2653
  * Accepts both {@link Destroyable} and {@link Maybe}<{@link Destroyable}> values,
2639
2654
  * skipping cleanup for nullish emissions.
2640
2655
  *
2641
- * @param wait - whether to wait for the previous destroy to complete before emitting
2642
- * @returns an operator that manages Destroyable lifecycle
2656
+ * @param wait - Whether to wait for the previous destroy to complete before emitting.
2657
+ * @returns An operator that manages Destroyable lifecycle.
2643
2658
  */ function cleanupDestroyable(wait) {
2644
2659
  return cleanup(function(x) {
2645
2660
  if (x) {
@@ -2653,13 +2668,13 @@ var DEFAULT_FACTORY_TIMER_INTERVAL = 1000;
2653
2668
  *
2654
2669
  * Only considers the first emission from the source. The result is shared via `shareReplay(1)`.
2655
2670
  *
2671
+ * @returns An operator that tracks whether the first value has been emitted.
2672
+ *
2656
2673
  * @example
2657
2674
  * ```ts
2658
2675
  * const loading$ = dataFetch$.pipe(isLoading());
2659
2676
  * // emits true initially, then false once dataFetch$ emits
2660
2677
  * ```
2661
- *
2662
- * @returns an operator that tracks whether the first value has been emitted
2663
2678
  */ function isLoading() {
2664
2679
  return function(source) {
2665
2680
  return source.pipe(rxjs.first(), rxjs.map(function() {
@@ -2687,8 +2702,8 @@ function tapLog(messageOrFunction) {
2687
2702
  *
2688
2703
  * Useful for simulating network latency or staggering requests.
2689
2704
  *
2690
- * @param maxOrArgs - maximum delay in ms, or a full random number config
2691
- * @returns an operator that delays each emission by a random amount
2705
+ * @param maxOrArgs - Maximum delay in ms, or a full random number config.
2706
+ * @returns An operator that delays each emission by a random amount.
2692
2707
  */ function randomDelay(maxOrArgs) {
2693
2708
  var makeRandomDelay = util.randomNumberFactory(maxOrArgs);
2694
2709
  return randomDelayWithRandomFunction(makeRandomDelay);
@@ -2696,9 +2711,10 @@ function tapLog(messageOrFunction) {
2696
2711
  /**
2697
2712
  * RxJS operator that adds a random delay using a custom random number generator.
2698
2713
  *
2699
- * @param makeRandomDelay - factory that produces random delay values
2700
- * @param scheduler - the scheduler to use for the delay (defaults to asyncScheduler)
2701
- * @returns an operator that delays each emission
2714
+ * @param makeRandomDelay - Factory that produces random delay values.
2715
+ * @param scheduler - The scheduler to use for the delay (defaults to asyncScheduler)
2716
+ * @returns An operator that delays each emission.
2717
+ *
2702
2718
  * @__NO_SIDE_EFFECTS__
2703
2719
  */ function randomDelayWithRandomFunction(makeRandomDelay) {
2704
2720
  var scheduler = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : rxjs.asyncScheduler;
@@ -2710,7 +2726,7 @@ function tapLog(messageOrFunction) {
2710
2726
  /**
2711
2727
  * `distinctUntilChanged` variant that only emits when the model's `id` property changes.
2712
2728
  *
2713
- * @returns operator that suppresses consecutive emissions with the same model `id`
2729
+ * @returns Operator that suppresses consecutive emissions with the same model `id`
2714
2730
  */ function distinctUntilModelIdChange() {
2715
2731
  return distinctUntilObjectKeyChange(function(x) {
2716
2732
  return x.id;
@@ -2719,7 +2735,7 @@ function tapLog(messageOrFunction) {
2719
2735
  /**
2720
2736
  * `distinctUntilChanged` variant that only emits when the model's `key` property changes.
2721
2737
  *
2722
- * @returns operator that suppresses consecutive emissions with the same model `key`
2738
+ * @returns Operator that suppresses consecutive emissions with the same model `key`
2723
2739
  */ function distinctUntilModelKeyChange() {
2724
2740
  return distinctUntilObjectKeyChange(function(x) {
2725
2741
  return x.key;
@@ -2730,8 +2746,8 @@ function tapLog(messageOrFunction) {
2730
2746
  * RxJS operator that extracts values from a keyed object using a keys observable,
2731
2747
  * returning only the values whose keys are present in both.
2732
2748
  *
2733
- * @param keysObs - observable (or static value) of keys to intersect with
2734
- * @returns an operator that maps a keyed object to an array of matching values
2749
+ * @param keysObs - Observable (or static value) of keys to intersect with.
2750
+ * @returns An operator that maps a keyed object to an array of matching values.
2735
2751
  */ function mapKeysIntersectionToArray(keysObs) {
2736
2752
  return rxjs.switchMap(function(object) {
2737
2753
  return asObservable(keysObs).pipe(rxjs.map(function(keys) {
@@ -2742,7 +2758,7 @@ function tapLog(messageOrFunction) {
2742
2758
  /**
2743
2759
  * `distinctUntilChanged` variant for `Map` instances that only emits when the set of map keys changes.
2744
2760
  *
2745
- * @returns an operator that filters out Maps with unchanged key sets
2761
+ * @returns An operator that filters out Maps with unchanged key sets.
2746
2762
  */ function distinctUntilMapHasDifferentKeys() {
2747
2763
  return rxjs.distinctUntilChanged(util.mapsHaveSameKeys);
2748
2764
  }
@@ -2798,8 +2814,8 @@ function _object_spread_props$7(target, source) {
2798
2814
  * RxJS operator that counts emissions as they occur using `scan`, emitting the running count
2799
2815
  * after each emission (unlike `count()` which only emits on completion).
2800
2816
  *
2801
- * @param startAt - initial count value (defaults to 0)
2802
- * @returns an operator that emits the running emission count
2817
+ * @param startAt - Initial count value (defaults to 0)
2818
+ * @returns An operator that emits the running emission count.
2803
2819
  */ function scanCount() {
2804
2820
  var startAt = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
2805
2821
  return rxjs.scan(function(count) {
@@ -2809,8 +2825,8 @@ function _object_spread_props$7(target, source) {
2809
2825
  /**
2810
2826
  * Creates a {@link factoryTimer} that emits incrementing numbers on an interval.
2811
2827
  *
2812
- * @param config - timer and incrementing number configuration
2813
- * @returns an observable of incrementing numbers
2828
+ * @param config - Timer and incrementing number configuration.
2829
+ * @returns An observable of incrementing numbers.
2814
2830
  */ function incrementingNumberTimer() {
2815
2831
  var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2816
2832
  return factoryTimer(_object_spread_props$7(_object_spread$7({}, config), {
@@ -2869,10 +2885,10 @@ function _unsupported_iterable_to_array$6(o, minLen) {
2869
2885
  *
2870
2886
  * Emits the `initial` value first, then taps on the first emitted value to run the provided callback.
2871
2887
  *
2872
- * @param tap - side-effect function called with the first value
2873
- * @param initial - optional starting value emitted before the source
2874
- * @param skipFirst - if true, skips tapping the initial value
2875
- * @returns an operator that initializes the pipe with a tap
2888
+ * @param tap - Side-effect function called with the first value.
2889
+ * @param initial - Optional starting value emitted before the source.
2890
+ * @param skipFirst - If true, skips tapping the initial value.
2891
+ * @returns An operator that initializes the pipe with a tap.
2876
2892
  */ function initialize(tap, initial, skipFirst) {
2877
2893
  return function(source) {
2878
2894
  var subscriber = source.pipe(rxjs.startWith(initial), tapFirst(function(x) {
@@ -2884,9 +2900,9 @@ function _unsupported_iterable_to_array$6(o, minLen) {
2884
2900
  /**
2885
2901
  * Executes a side-effect on the first emission from the observable, then passes all values through.
2886
2902
  *
2887
- * @param tap - the side-effect function to call once
2888
- * @param skipFirst - if true, skips the very first emission before tapping
2889
- * @returns an operator that taps the first value
2903
+ * @param tap - The side-effect function to call once.
2904
+ * @param skipFirst - If true, skips the very first emission before tapping.
2905
+ * @returns An operator that taps the first value.
2890
2906
  */ function tapFirst(tap) {
2891
2907
  var skipFirst = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
2892
2908
  return rxjs.skipWhile(function(value) {
@@ -2901,8 +2917,8 @@ function _unsupported_iterable_to_array$6(o, minLen) {
2901
2917
  * The subscription will never have `complete()` called since it only triggers after unsubscription.
2902
2918
  * Use `finalize()` for additional cleanup.
2903
2919
  *
2904
- * @param obs - the source observable to wrap
2905
- * @returns an observable that only completes on unsubscription
2920
+ * @param obs - The source observable to wrap.
2921
+ * @returns An observable that only completes on unsubscription.
2906
2922
  */ function preventComplete(obs) {
2907
2923
  var complete = new rxjs.BehaviorSubject(0);
2908
2924
  return rxjs.combineLatest([
@@ -2920,14 +2936,14 @@ function _unsupported_iterable_to_array$6(o, minLen) {
2920
2936
  *
2921
2937
  * Unlike `from()`, the promise/observable is not created until the first subscriber connects.
2922
2938
  *
2939
+ * @param getter - Factory that returns a Promise or Observable.
2940
+ * @returns A shared observable that defers execution until subscription.
2941
+ *
2923
2942
  * @example
2924
2943
  * ```ts
2925
2944
  * const data$ = lazyFrom(() => fetch('/api/data').then(r => r.json()));
2926
2945
  * // The fetch is not called until data$ is subscribed to
2927
2946
  * ```
2928
- *
2929
- * @param getter - factory that returns a Promise or Observable
2930
- * @returns a shared observable that defers execution until subscription
2931
2947
  */ function lazyFrom(getter) {
2932
2948
  return rxjs.of(undefined).pipe(rxjs.mergeMap(function() {
2933
2949
  return rxjs.from(getter());
@@ -2939,9 +2955,9 @@ function _unsupported_iterable_to_array$6(o, minLen) {
2939
2955
  *
2940
2956
  * Uses {@link filterUniqueFunction} to deduplicate emitted arrays by extracting a key from each item.
2941
2957
  *
2942
- * @param readKey - function to extract the unique key from each item
2943
- * @param additionalKeysInput - optional additional keys to include in the unique set
2944
- * @returns an operator that emits deduplicated arrays
2958
+ * @param readKey - Function to extract the unique key from each item.
2959
+ * @param additionalKeysInput - Optional additional keys to include in the unique set.
2960
+ * @returns An operator that emits deduplicated arrays.
2945
2961
  */ function filterUnique(readKey, additionalKeysInput) {
2946
2962
  var filterFn = util.filterUniqueFunction(readKey, additionalKeysInput);
2947
2963
  return rxjs.map(function(x) {
@@ -2958,6 +2974,9 @@ function _unsupported_iterable_to_array$6(o, minLen) {
2958
2974
  * Each call pushes a value onto the internal subject and returns the shared, throttled observable.
2959
2975
  * Useful for debouncing repeated calls while sharing a single observable output.
2960
2976
  *
2977
+ * @param config - Optional throttle, distinct, and pipe settings.
2978
+ * @returns An async pusher function.
2979
+ *
2961
2980
  * @example
2962
2981
  * ```ts
2963
2982
  * const pusher = asyncPusher<string>({ throttle: 100 });
@@ -2967,9 +2986,6 @@ function _unsupported_iterable_to_array$6(o, minLen) {
2967
2986
  * // clean up
2968
2987
  * pusher.destroy();
2969
2988
  * ```
2970
- *
2971
- * @param config - optional throttle, distinct, and pipe settings
2972
- * @returns an async pusher function
2973
2989
  */ function asyncPusher() {
2974
2990
  var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2975
2991
  var _config_throttle = config.throttle, throttle = _config_throttle === void 0 ? DEFAULT_ASYNC_PUSHER_THROTTLE : _config_throttle, cleanupObs = config.cleanupObs, _config_distinct = config.distinct, distinct = _config_distinct === void 0 ? true : _config_distinct, pipeObs = config.pipe;
@@ -3015,8 +3031,8 @@ function _unsupported_iterable_to_array$6(o, minLen) {
3015
3031
  *
3016
3032
  * The factory optionally accepts a cleanup observable — when it completes, the pusher is destroyed.
3017
3033
  *
3018
- * @param config - optional config passed to the underlying async pusher
3019
- * @returns a cached factory that produces an async pusher
3034
+ * @param config - Optional config passed to the underlying async pusher.
3035
+ * @returns A cached factory that produces an async pusher.
3020
3036
  */ function asyncPusherCache(config) {
3021
3037
  return util.cachedGetter(function(cleanupObs) {
3022
3038
  var pusher = asyncPusher(config);
@@ -3089,8 +3105,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3089
3105
  * Creates a function that takes a `Map` and combines the latest emissions from observables
3090
3106
  * created from each map value.
3091
3107
  *
3092
- * @param mapToObs - function to transform each map value into an observable
3093
- * @returns a function that converts a Map to a combined observable of results
3108
+ * @param mapToObs - Function to transform each map value into an observable.
3109
+ * @returns Operator-ready function that combines the per-entry observables into one emission of results.
3094
3110
  */ function combineLatestFromMapValuesObsFn(mapToObs) {
3095
3111
  var combineArrayFn = combineLatestFromArrayObsFn(mapToObs);
3096
3112
  return function(latestMap) {
@@ -3105,8 +3121,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3105
3121
  *
3106
3122
  * Returns `of([])` for empty arrays.
3107
3123
  *
3108
- * @param mapToObs - function to transform each value into an observable
3109
- * @returns a function that converts an array to a combined observable
3124
+ * @param mapToObs - Function to transform each value into an observable.
3125
+ * @returns Operator-ready function that combines the latest emissions from each derived observable.
3110
3126
  */ function combineLatestFromArrayObsFn(mapToObs) {
3111
3127
  return function(latest) {
3112
3128
  var newObs = latest.map(mapToObs);
@@ -3119,6 +3135,9 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3119
3135
  * Each key in the input object maps to an observable (or static value). The result observable
3120
3136
  * emits an object with the same keys, where each value is the latest emission from its source.
3121
3137
  *
3138
+ * @param objectMap - An object whose values are observables or static values.
3139
+ * @returns An observable that emits the resolved object.
3140
+ *
3122
3141
  * @example
3123
3142
  * ```ts
3124
3143
  * const result$ = combineLatestFromObject({
@@ -3127,9 +3146,6 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3127
3146
  * });
3128
3147
  * // emits { name: 'Alice', age: 30 }
3129
3148
  * ```
3130
- *
3131
- * @param objectMap - an object whose values are observables or static values
3132
- * @returns an observable that emits the resolved object
3133
3149
  */ function combineLatestFromObject(objectMap) {
3134
3150
  var pairs = util.allKeyValueTuples(objectMap);
3135
3151
  var observables = pairs.map(function(x) {
@@ -3153,8 +3169,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3153
3169
  /**
3154
3170
  * RxJS operator that maps an array of items to a `Map<K, T>` using the provided key reader.
3155
3171
  *
3156
- * @param read - function to extract the key from each item
3157
- * @returns an operator that converts an array into a keyed Map
3172
+ * @param read - Function to extract the key from each item.
3173
+ * @returns An operator that converts an array into a keyed Map.
3158
3174
  */ function keyValueMap(read) {
3159
3175
  return rxjs.map(util.keyValueMapFactory(read));
3160
3176
  }
@@ -3162,8 +3178,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3162
3178
  * RxJS operator that maps an array of items to a `Map<K, T>` using a multi-key reader,
3163
3179
  * allowing each item to appear under multiple keys.
3164
3180
  *
3165
- * @param read - function to extract multiple keys from each item
3166
- * @returns an operator that converts an array into a multi-keyed Map
3181
+ * @param read - Function to extract multiple keys from each item.
3182
+ * @returns An operator that converts an array into a multi-keyed Map.
3167
3183
  */ function multiKeyValueMap(read) {
3168
3184
  return rxjs.map(util.multiKeyValueMapFactory(read));
3169
3185
  }
@@ -3174,6 +3190,9 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3174
3190
  *
3175
3191
  * Useful as a safety valve to detect infinite loops or runaway observables.
3176
3192
  *
3193
+ * @param config - Period duration, max emissions, and error/fallback handling.
3194
+ * @returns An operator that monitors emission frequency.
3195
+ *
3177
3196
  * @example
3178
3197
  * ```ts
3179
3198
  * source$.pipe(
@@ -3181,9 +3200,6 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3181
3200
  * ).subscribe();
3182
3201
  * // throws if more than 100 emissions occur within 1 second
3183
3202
  * ```
3184
- *
3185
- * @param config - period duration, max emissions, and error/fallback handling
3186
- * @returns an operator that monitors emission frequency
3187
3203
  */ function errorOnEmissionsInPeriod(config) {
3188
3204
  var _config_period = config.period, period = _config_period === void 0 ? 1000 : _config_period, maxEmissionsPerPeriod = config.maxEmissionsPerPeriod, onError = config.onError, inputErrorFactory = config.errorFactory, inputErrorMessage = config.errorMessage, switchToObs = config.switchToObs;
3189
3205
  var errorMessage = inputErrorMessage !== null && inputErrorMessage !== void 0 ? inputErrorMessage : 'errorOnEmissionsInPeriod(): Too many emissions in time period.';
@@ -3192,8 +3208,9 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3192
3208
  } : undefined;
3193
3209
  return function(source) {
3194
3210
  var counter = util.timePeriodCounter(period);
3211
+ var result;
3195
3212
  if (errorFactory) {
3196
- return source.pipe(rxjs.map(function(x) {
3213
+ result = source.pipe(rxjs.map(function(x) {
3197
3214
  if (counter() > maxEmissionsPerPeriod) {
3198
3215
  var error = errorFactory();
3199
3216
  onError === null || onError === void 0 ? void 0 : onError(error);
@@ -3201,19 +3218,21 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3201
3218
  }
3202
3219
  return x;
3203
3220
  }));
3221
+ } else {
3222
+ // switchToObs was provided.
3223
+ result = source.pipe(rxjs.switchMap(function(x) {
3224
+ return counter() > maxEmissionsPerPeriod ? switchToObs : rxjs.of(x);
3225
+ }));
3204
3226
  }
3205
- // switchToObs was provided.
3206
- return source.pipe(rxjs.switchMap(function(x) {
3207
- return counter() > maxEmissionsPerPeriod ? switchToObs : rxjs.of(x);
3208
- }));
3227
+ return result;
3209
3228
  };
3210
3229
  }
3211
3230
 
3212
3231
  /**
3213
3232
  * RxJS operator that checks whether the emitted `Set` contains all values from the given observable.
3214
3233
  *
3215
- * @param valuesObs - observable of values to check against
3216
- * @returns an operator that emits true if all values are contained in the set
3234
+ * @param valuesObs - Observable of values to check against.
3235
+ * @returns An operator that emits true if all values are contained in the set.
3217
3236
  */ function setContainsAllValuesFrom(valuesObs) {
3218
3237
  return combineLatestMapFrom(valuesObs, function(set, values) {
3219
3238
  return util.setContainsAllValues(set, values !== null && values !== void 0 ? values : []);
@@ -3222,8 +3241,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3222
3241
  /**
3223
3242
  * RxJS operator that checks whether the emitted `Set` contains any value from the given observable.
3224
3243
  *
3225
- * @param valuesObs - observable of values to check against
3226
- * @returns an operator that emits true if any value is contained in the set
3244
+ * @param valuesObs - Observable of values to check against.
3245
+ * @returns An operator that emits true if any value is contained in the set.
3227
3246
  */ function setContainsAnyValueFrom(valuesObs) {
3228
3247
  return combineLatestMapFrom(valuesObs, function(set, values) {
3229
3248
  return util.setContainsAnyValue(set, values !== null && values !== void 0 ? values : []);
@@ -3232,8 +3251,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3232
3251
  /**
3233
3252
  * RxJS operator that checks whether the emitted `Set` contains none of the values from the given observable.
3234
3253
  *
3235
- * @param valuesObs - observable of values to check against
3236
- * @returns an operator that emits true if no values are contained in the set
3254
+ * @param valuesObs - Observable of values to check against.
3255
+ * @returns An operator that emits true if no values are contained in the set.
3237
3256
  */ function setContainsNoValueFrom(valuesObs) {
3238
3257
  return combineLatestMapFrom(valuesObs, function(set, values) {
3239
3258
  return util.setContainsNoneOfValue(set, values !== null && values !== void 0 ? values : []);
@@ -3242,7 +3261,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3242
3261
  /**
3243
3262
  * `distinctUntilChanged` variant for iterables that only emits when the contained values change.
3244
3263
  *
3245
- * @returns operator that suppresses consecutive iterable emissions with the same set of values
3264
+ * @returns Operator that suppresses consecutive iterable emissions with the same set of values.
3246
3265
  */ function distinctUntilHasDifferentValues() {
3247
3266
  return rxjs.distinctUntilChanged(util.hasSameValues);
3248
3267
  }
@@ -3250,8 +3269,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3250
3269
  * `distinctUntilChanged` variant that extracts iterable values from the emitted item and only emits
3251
3270
  * when the set of extracted values changes.
3252
3271
  *
3253
- * @param readValues - function to extract the iterable of values to compare
3254
- * @returns operator that suppresses consecutive emissions whose extracted iterable values are the same
3272
+ * @param readValues - Function to extract the iterable of values to compare.
3273
+ * @returns Operator that suppresses consecutive emissions whose extracted iterable values are the same.
3255
3274
  */ function distinctUntilItemsHaveDifferentValues(readValues) {
3256
3275
  return distinctUntilItemsValueChanges(readValues, util.hasSameValues);
3257
3276
  }
@@ -3259,9 +3278,9 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3259
3278
  * `distinctUntilChanged` variant that extracts values from the emitted item and compares them
3260
3279
  * using a custom equality comparator.
3261
3280
  *
3262
- * @param readValues - function to extract the value to compare
3263
- * @param isEqualComparator - custom equality function for the extracted values
3264
- * @returns operator that suppresses consecutive emissions whose extracted values are considered equal
3281
+ * @param readValues - Function to extract the value to compare.
3282
+ * @param isEqualComparator - Custom equality function for the extracted values.
3283
+ * @returns Operator that suppresses consecutive emissions whose extracted values are considered equal.
3265
3284
  */ function distinctUntilItemsValueChanges(readValues, isEqualComparator) {
3266
3285
  return rxjs.distinctUntilChanged(util.compareEqualityWithValueFromItemsFunction(readValues, isEqualComparator));
3267
3286
  }
@@ -3272,6 +3291,9 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3272
3291
  * Combines the source array with the `search$` observable and applies the configured
3273
3292
  * search string filter function. When the search is null/undefined, all items pass through.
3274
3293
  *
3294
+ * @param config - Search filter configuration with filter function and search$ observable.
3295
+ * @returns An operator that filters arrays by search string.
3296
+ *
3275
3297
  * @example
3276
3298
  * ```ts
3277
3299
  * const items$ = of(['apple', 'banana', 'cherry']);
@@ -3282,9 +3304,6 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3282
3304
  * ).subscribe(console.log);
3283
3305
  * // ['banana']
3284
3306
  * ```
3285
- *
3286
- * @param config - search filter configuration with filter function and search$ observable
3287
- * @returns an operator that filters arrays by search string
3288
3307
  */ function filterWithSearchString(config) {
3289
3308
  var filter = config.filter, search$ = config.search$;
3290
3309
  var filterFactory = util.searchStringFilterFunction(filter);
@@ -3299,8 +3318,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3299
3318
  * Subscribes to the observable, calls the provided function with the first emitted value,
3300
3319
  * then automatically unsubscribes.
3301
3320
  *
3302
- * @param obs - the source observable
3303
- * @param useFn - function to call with the first value
3321
+ * @param obs - The source observable.
3322
+ * @param useFn - Function to call with the first value.
3304
3323
  */ function useFirst(obs, useFn) {
3305
3324
  obs.pipe(rxjs.first()).subscribe(useFn);
3306
3325
  }
@@ -3311,6 +3330,8 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3311
3330
  *
3312
3331
  * Useful for flattening an observable of optional loading contexts into a single stream of loading events.
3313
3332
  *
3333
+ * @returns An RxJS operator that switches to the stream$ of each non-null LoadingContext.
3334
+ *
3314
3335
  * @example
3315
3336
  * ```ts
3316
3337
  * const context$ = new BehaviorSubject<Maybe<LoadingContext>>(myLoadingContext);
@@ -3321,8 +3342,6 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3321
3342
  * // emits LoadingContextEvent values from myLoadingContext.stream$
3322
3343
  * // emits undefined when context$ emits null/undefined
3323
3344
  * ```
3324
- *
3325
- * @returns an RxJS operator that switches to the stream$ of each non-null LoadingContext
3326
3345
  */ function switchMapMaybeLoadingContextStream() {
3327
3346
  return rxjs.switchMap(function(x) {
3328
3347
  return x != null ? x.stream$ : rxjs.of(undefined);
@@ -3404,6 +3423,10 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3404
3423
  /**
3405
3424
  * Compares two {@link LoadingState} instances for shallow equality across all key properties.
3406
3425
  *
3426
+ * @param a - First loading state.
3427
+ * @param b - Second loading state.
3428
+ * @returns True if loading, loadingProgress, error, and value are all strictly equal.
3429
+ *
3407
3430
  * @example
3408
3431
  * ```ts
3409
3432
  * const a = successResult('hello');
@@ -3413,10 +3436,6 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3413
3436
  * const c = beginLoading();
3414
3437
  * isLoadingStateEqual(a, c); // false
3415
3438
  * ```
3416
- *
3417
- * @param a - first loading state
3418
- * @param b - second loading state
3419
- * @returns true if loading, loadingProgress, error, and value are all strictly equal
3420
3439
  */ function isLoadingStateEqual(a, b) {
3421
3440
  return a.loading === b.loading && a.loadingProgress === b.loadingProgress && a.error === b.error && a.value === b.value;
3422
3441
  }
@@ -3426,9 +3445,9 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3426
3445
  *
3427
3446
  * Does not compare the `value` property — only structural metadata.
3428
3447
  *
3429
- * @param a - first loading error pair
3430
- * @param b - second loading error pair
3431
- * @returns true if both pairs have equivalent metadata
3448
+ * @param a - First loading error pair.
3449
+ * @param b - Second loading error pair.
3450
+ * @returns True if both pairs have equivalent metadata.
3432
3451
  */ function isLoadingStateMetadataEqual(a, b) {
3433
3452
  return a.loading == b.loading && util.valuesAreBothNullishOrEquivalent(a.loadingProgress, b.loadingProgress) && util.valuesAreBothNullishOrEquivalent(a.error, b.error);
3434
3453
  }
@@ -3456,6 +3475,9 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3456
3475
  * Returns `LOADING` if still loading, `SUCCESS` if finished with a value key,
3457
3476
  * `ERROR` if finished with an error key, or `IDLE` if finished with neither.
3458
3477
  *
3478
+ * @param loadingState - The loading state to classify.
3479
+ * @returns The corresponding {@link LoadingStateType}
3480
+ *
3459
3481
  * @example
3460
3482
  * ```ts
3461
3483
  * loadingStateType(beginLoading()); // LoadingStateType.LOADING
@@ -3463,9 +3485,6 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3463
3485
  * loadingStateType(errorResult(new Error())); // LoadingStateType.ERROR
3464
3486
  * loadingStateType({ loading: false }); // LoadingStateType.IDLE
3465
3487
  * ```
3466
- *
3467
- * @param loadingState - the loading state to classify
3468
- * @returns the corresponding {@link LoadingStateType}
3469
3488
  */ function loadingStateType(loadingState) {
3470
3489
  var isLoading = !isLoadingStateFinishedLoading(loadingState);
3471
3490
  var type;
@@ -3488,6 +3507,9 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3488
3507
  * Returns `true` when `loading` is explicitly `false`, or when `loading` is not `true`
3489
3508
  * and either a value, error, or `null` value is present.
3490
3509
  *
3510
+ * @param state - The loading state to check (may be null/undefined)
3511
+ * @returns True if loading is complete.
3512
+ *
3491
3513
  * @example
3492
3514
  * ```ts
3493
3515
  * isLoadingStateFinishedLoading(successResult('done')); // true
@@ -3495,9 +3517,6 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3495
3517
  * isLoadingStateFinishedLoading({ loading: false }); // true
3496
3518
  * isLoadingStateFinishedLoading(null); // false
3497
3519
  * ```
3498
- *
3499
- * @param state - the loading state to check (may be null/undefined)
3500
- * @returns true if loading is complete
3501
3520
  */ function isLoadingStateFinishedLoading(state) {
3502
3521
  var result = false;
3503
3522
  if (state) {
@@ -3516,14 +3535,14 @@ function _unsupported_iterable_to_array$4(o, minLen) {
3516
3535
  *
3517
3536
  * Represents a state where no loading has been initiated yet.
3518
3537
  *
3538
+ * @returns A loading state with `loading: false` and no value or error.
3539
+ *
3519
3540
  * @example
3520
3541
  * ```ts
3521
3542
  * const state = idleLoadingState();
3522
3543
  * // { loading: false }
3523
3544
  * loadingStateType(state); // LoadingStateType.IDLE
3524
3545
  * ```
3525
- *
3526
- * @returns a loading state with `loading: false` and no value or error
3527
3546
  */ function idleLoadingState() {
3528
3547
  return {
3529
3548
  loading: false
@@ -3539,9 +3558,9 @@ function beginLoading(state) {
3539
3558
  /**
3540
3559
  * Creates a {@link PageLoadingState} that is loading for the given page number.
3541
3560
  *
3542
- * @param page - the page number being loaded
3543
- * @param state - optional partial state to merge
3544
- * @returns a page loading state with `loading: true`
3561
+ * @param page - The page number being loaded.
3562
+ * @param state - Optional partial state to merge.
3563
+ * @returns A page loading state with `loading: true`
3545
3564
  */ function beginLoadingPage(page, state) {
3546
3565
  return state ? _object_spread_props$6(_object_spread$6({
3547
3566
  page: page
@@ -3555,14 +3574,14 @@ function beginLoading(state) {
3555
3574
  /**
3556
3575
  * Creates a successful {@link LoadingState} with the given value and `loading: false`.
3557
3576
  *
3577
+ * @param value - The loaded value.
3578
+ * @returns A loading state representing a successful result.
3579
+ *
3558
3580
  * @example
3559
3581
  * ```ts
3560
3582
  * const state = successResult({ name: 'Alice' });
3561
3583
  * // { value: { name: 'Alice' }, loading: false }
3562
3584
  * ```
3563
- *
3564
- * @param value - the loaded value
3565
- * @returns a loading state representing a successful result
3566
3585
  */ function successResult(value) {
3567
3586
  return {
3568
3587
  value: value,
@@ -3572,9 +3591,9 @@ function beginLoading(state) {
3572
3591
  /**
3573
3592
  * Creates a successful {@link PageLoadingState} for a specific page.
3574
3593
  *
3575
- * @param page - the page number
3576
- * @param value - the loaded value
3577
- * @returns a page loading state representing success
3594
+ * @param page - The page number.
3595
+ * @param value - The loaded value.
3596
+ * @returns A page loading state representing success.
3578
3597
  */ function successPageResult(page, value) {
3579
3598
  return _object_spread_props$6(_object_spread$6({}, successResult(value)), {
3580
3599
  page: page
@@ -3585,14 +3604,14 @@ function beginLoading(state) {
3585
3604
  *
3586
3605
  * Converts the input error to a {@link ReadableError} via {@link toReadableError}.
3587
3606
  *
3607
+ * @param error - The error to wrap (string, Error, or ReadableError)
3608
+ * @returns A loading state representing an error.
3609
+ *
3588
3610
  * @example
3589
3611
  * ```ts
3590
3612
  * const state = errorResult(new Error('Not found'));
3591
3613
  * // { error: { message: 'Not found', ... }, loading: false }
3592
3614
  * ```
3593
- *
3594
- * @param error - the error to wrap (string, Error, or ReadableError)
3595
- * @returns a loading state representing an error
3596
3615
  */ function errorResult(error) {
3597
3616
  return {
3598
3617
  error: util.toReadableError(error),
@@ -3602,9 +3621,9 @@ function beginLoading(state) {
3602
3621
  /**
3603
3622
  * Creates a {@link PageLoadingState} representing an error for a specific page.
3604
3623
  *
3605
- * @param page - the page number
3606
- * @param error - the error to include
3607
- * @returns a page loading state representing an error
3624
+ * @param page - The page number.
3625
+ * @param error - The error to include.
3626
+ * @returns A page loading state representing an error.
3608
3627
  */ function errorPageResult(page, error) {
3609
3628
  return _object_spread_props$6(_object_spread$6({}, errorResult(error)), {
3610
3629
  page: page
@@ -3613,28 +3632,28 @@ function beginLoading(state) {
3613
3632
  /**
3614
3633
  * Whether any of the given {@link LoadingState} instances are currently loading.
3615
3634
  *
3635
+ * @param states - Array of loading states to check.
3636
+ * @returns True if at least one state is loading.
3637
+ *
3616
3638
  * @example
3617
3639
  * ```ts
3618
3640
  * isAnyLoadingStateInLoadingState([successResult(1), beginLoading()]); // true
3619
3641
  * isAnyLoadingStateInLoadingState([successResult(1), successResult(2)]); // false
3620
3642
  * ```
3621
- *
3622
- * @param states - array of loading states to check
3623
- * @returns true if at least one state is loading
3624
3643
  */ function isAnyLoadingStateInLoadingState(states) {
3625
3644
  return util.reduceBooleansWithOr(states.map(isLoadingStateLoading), false);
3626
3645
  }
3627
3646
  /**
3628
3647
  * Whether all given {@link LoadingState} instances have finished loading.
3629
3648
  *
3649
+ * @param states - Array of loading states to check.
3650
+ * @returns True if every state has finished loading.
3651
+ *
3630
3652
  * @example
3631
3653
  * ```ts
3632
3654
  * areAllLoadingStatesFinishedLoading([successResult(1), successResult(2)]); // true
3633
3655
  * areAllLoadingStatesFinishedLoading([successResult(1), beginLoading()]); // false
3634
3656
  * ```
3635
- *
3636
- * @param states - array of loading states to check
3637
- * @returns true if every state has finished loading
3638
3657
  */ function areAllLoadingStatesFinishedLoading(states) {
3639
3658
  return util.reduceBooleansWithAnd(states.map(isLoadingStateFinishedLoading), true);
3640
3659
  }
@@ -3643,8 +3662,8 @@ function beginLoading(state) {
3643
3662
  *
3644
3663
  * When the target type is `IDLE`, returns `true` for null/undefined states.
3645
3664
  *
3646
- * @param type - the loading state type to match against
3647
- * @returns a predicate function for the given type
3665
+ * @param type - The loading state type to match against.
3666
+ * @returns A predicate function for the given type.
3648
3667
  */ function isLoadingStateWithStateType(type) {
3649
3668
  var defaultResult = type === exports.LoadingStateType.IDLE;
3650
3669
  return function(state) {
@@ -3681,45 +3700,45 @@ function beginLoading(state) {
3681
3700
  /**
3682
3701
  * Type guard that checks whether a {@link LoadingState} has a non-undefined value, regardless of loading status.
3683
3702
  *
3703
+ * @param state - The loading state to check.
3704
+ * @returns True if the state has a defined (non-undefined) value.
3705
+ *
3684
3706
  * @example
3685
3707
  * ```ts
3686
3708
  * isLoadingStateWithDefinedValue(successResult('hello')); // true
3687
3709
  * isLoadingStateWithDefinedValue(successResult(null)); // true (null is defined)
3688
3710
  * isLoadingStateWithDefinedValue(beginLoading()); // false
3689
3711
  * ```
3690
- *
3691
- * @param state - the loading state to check
3692
- * @returns true if the state has a defined (non-undefined) value
3693
3712
  */ function isLoadingStateWithDefinedValue(state) {
3694
3713
  return state ? state.value !== undefined : false;
3695
3714
  }
3696
3715
  /**
3697
3716
  * Type guard that checks whether a {@link LoadingState} has a non-null error, regardless of loading status.
3698
3717
  *
3718
+ * @param state - The loading state to check.
3719
+ * @returns True if the state has an error.
3720
+ *
3699
3721
  * @example
3700
3722
  * ```ts
3701
3723
  * isLoadingStateWithError(errorResult(new Error('fail'))); // true
3702
3724
  * isLoadingStateWithError(successResult('ok')); // false
3703
3725
  * ```
3704
- *
3705
- * @param state - the loading state to check
3706
- * @returns true if the state has an error
3707
3726
  */ function isLoadingStateWithError(state) {
3708
3727
  return state ? state.error != null : false;
3709
3728
  }
3710
3729
  /**
3711
3730
  * Type guard that checks whether a {@link LoadingState} has finished loading and has a defined value.
3712
3731
  *
3713
- * @param state - the loading state to check
3714
- * @returns true if finished loading with a non-undefined value
3732
+ * @param state - The loading state to check.
3733
+ * @returns True if finished loading with a non-undefined value.
3715
3734
  */ function isLoadingStateFinishedLoadingWithDefinedValue(state) {
3716
3735
  return state ? isLoadingStateFinishedLoading(state) && state.value !== undefined : false;
3717
3736
  }
3718
3737
  /**
3719
3738
  * Type guard that checks whether a {@link LoadingState} has finished loading and has an error.
3720
3739
  *
3721
- * @param state - the loading state to check
3722
- * @returns true if finished loading with an error
3740
+ * @param state - The loading state to check.
3741
+ * @returns True if finished loading with an error.
3723
3742
  */ function isLoadingStateFinishedLoadingWithError(state) {
3724
3743
  return state ? isLoadingStateFinishedLoading(state) && state.error != null : false;
3725
3744
  }
@@ -3728,6 +3747,10 @@ function beginLoading(state) {
3728
3747
  *
3729
3748
  * Does not compare values — only structural metadata.
3730
3749
  *
3750
+ * @param a - First page loading state.
3751
+ * @param b - Second page loading state.
3752
+ * @returns True if metadata is equivalent.
3753
+ *
3731
3754
  * @example
3732
3755
  * ```ts
3733
3756
  * isPageLoadingStateMetadataEqual(
@@ -3740,10 +3763,6 @@ function beginLoading(state) {
3740
3763
  * { page: 2 }
3741
3764
  * ); // false
3742
3765
  * ```
3743
- *
3744
- * @param a - first page loading state
3745
- * @param b - second page loading state
3746
- * @returns true if metadata is equivalent
3747
3766
  */ function isPageLoadingStateMetadataEqual(a, b) {
3748
3767
  return util.valuesAreBothNullishOrEquivalent(a.page, b.page) && a.loading == b.loading && util.valuesAreBothNullishOrEquivalent(a.error, b.error);
3749
3768
  }
@@ -3805,9 +3824,9 @@ function mergeLoadingStates() {
3805
3824
  *
3806
3825
  * Useful for resetting a state back to loading or idle without losing other metadata (e.g., page).
3807
3826
  *
3808
- * @param state - the state to copy metadata from
3809
- * @param loading - whether to mark as loading (defaults to true)
3810
- * @returns a new state with value/error cleared
3827
+ * @param state - The state to copy metadata from.
3828
+ * @param loading - Whether to mark as loading (defaults to true)
3829
+ * @returns A new state with value/error cleared.
3811
3830
  */ function mergeLoadingStateWithLoading(state) {
3812
3831
  var loading = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
3813
3832
  return _object_spread_props$6(_object_spread$6({}, state), {
@@ -3819,9 +3838,9 @@ function mergeLoadingStates() {
3819
3838
  /**
3820
3839
  * Returns a copy of the state with the given value, `loading: false`, and error cleared.
3821
3840
  *
3822
- * @param state - the state to copy metadata from
3823
- * @param value - the new value to set
3824
- * @returns a new state representing success
3841
+ * @param state - The state to copy metadata from.
3842
+ * @param value - The new value to set.
3843
+ * @returns A new state representing success.
3825
3844
  */ function mergeLoadingStateWithValue(state, value) {
3826
3845
  return _object_spread_props$6(_object_spread$6({}, state), {
3827
3846
  value: value !== null && value !== void 0 ? value : undefined,
@@ -3832,9 +3851,9 @@ function mergeLoadingStates() {
3832
3851
  /**
3833
3852
  * Returns a copy of the state with the given error and `loading: false`.
3834
3853
  *
3835
- * @param state - the state to copy metadata from
3836
- * @param error - the error to set
3837
- * @returns a new state representing an error
3854
+ * @param state - The state to copy metadata from.
3855
+ * @param error - The error to set.
3856
+ * @returns A new state representing an error.
3838
3857
  */ function mergeLoadingStateWithError(state, error) {
3839
3858
  return _object_spread_props$6(_object_spread$6({}, state), {
3840
3859
  loading: false,
@@ -3846,10 +3865,9 @@ function mergeLoadingStates() {
3846
3865
  *
3847
3866
  * Returns `undefined` if any input is still loading or has an error.
3848
3867
  *
3849
- * @param input - array of loading states to combine
3850
- * @param config - mapping configuration with either `mapValues` or `mapState`
3851
- * @returns the combined loading state, or undefined if inputs are not ready
3852
- *
3868
+ * @param input - Array of loading states to combine.
3869
+ * @param config - Mapping configuration with either `mapValues` or `mapState`
3870
+ * @returns The combined loading state, or undefined if inputs are not ready.
3853
3871
  * @throws {Error} When neither `mapValues` nor `mapState` is provided in the config.
3854
3872
  */ function mapMultipleLoadingStateResults(input, config) {
3855
3873
  var mapValues = config.mapValues, mapState = config.mapState;
@@ -3899,8 +3917,9 @@ function mapLoadingStateResults(input, config) {
3899
3917
  * Creates a function that extracts and maps the value from a {@link LoadingState}, returning undefined
3900
3918
  * when the state has no value.
3901
3919
  *
3902
- * @param mapFn - function to transform the value and state into the output type
3903
- * @returns a function that accepts a loading state and returns the mapped value or undefined
3920
+ * @param mapFn - Function to transform the value and state into the output type.
3921
+ * @returns Mapper that yields the transformed value when present, or undefined when the state has none.
3922
+ *
3904
3923
  * @__NO_SIDE_EFFECTS__
3905
3924
  */ function mapLoadingStateValueFunction(mapFn) {
3906
3925
  return function(state) {
@@ -3993,6 +4012,10 @@ function _unsupported_iterable_to_array$3(o, minLen) {
3993
4012
  *
3994
4013
  * If firstOnly is provided, it will only take the first value the observable returns.
3995
4014
  *
4015
+ * @param obs - The source observable to wrap.
4016
+ * @param firstOnly - If true, only takes the first value from the observable.
4017
+ * @returns An observable that emits {@link LoadingState} values representing the loading lifecycle.
4018
+ *
3996
4019
  * @example
3997
4020
  * ```ts
3998
4021
  * // Wrap a data fetch observable into a LoadingState
@@ -4001,10 +4024,6 @@ function _unsupported_iterable_to_array$3(o, minLen) {
4001
4024
  * // Wrap an observable and only take the first emitted value
4002
4025
  * readonly singleValueState$ = loadingStateFromObs(this.data$, true);
4003
4026
  * ```
4004
- *
4005
- * @param obs - The source observable to wrap.
4006
- * @param firstOnly - If true, only takes the first value from the observable.
4007
- * @returns An observable that emits {@link LoadingState} values representing the loading lifecycle.
4008
4027
  */ function loadingStateFromObs(obs, firstOnly) {
4009
4028
  if (firstOnly) {
4010
4029
  obs = obs.pipe(rxjs.first());
@@ -4029,6 +4048,8 @@ function combineLoadingStates() {
4029
4048
  return x[i] !== y[i];
4030
4049
  });
4031
4050
  }), rxjs.map(function(states) {
4051
+ // TODO(breaking-change): pass O explicitly (mergeLoadingStates<O>(...states, mergeFn)) or restructure the variadic signature so O is inferable without the cast.
4052
+ // TODO: Fix eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- mergeLoadingStates is variadic; the generic O cannot be inferred from the call, so tsc widens the result to LoadingState<unknown> without this cast
4032
4053
  return mergeLoadingStates.apply(void 0, _to_consumable_array$1(states).concat([
4033
4054
  mergeFn
4034
4055
  ]));
@@ -4042,6 +4063,9 @@ function combineLoadingStates() {
4042
4063
  * If any source has an error, the error is propagated. If any source is still loading, the result is loading.
4043
4064
  * When all sources are successful, the result value is `true`.
4044
4065
  *
4066
+ * @param sources - LoadingState observables whose statuses participate in the combined emission.
4067
+ * @returns An observable emitting a {@link LoadingState}<boolean> representing the combined status.
4068
+ *
4045
4069
  * @example
4046
4070
  * ```ts
4047
4071
  * const success$ = of(successResult(1));
@@ -4054,9 +4078,6 @@ function combineLoadingStates() {
4054
4078
  * const loading$ = of(beginLoading());
4055
4079
  * const status$ = combineLoadingStatesStatus([loading$, success$]);
4056
4080
  * ```
4057
- *
4058
- * @param sources - An array of LoadingState observables to combine.
4059
- * @returns An observable emitting a {@link LoadingState}<boolean> representing the combined status.
4060
4081
  */ function combineLoadingStatesStatus(sources) {
4061
4082
  return rxjs.combineLatest(sources).pipe(rxjs.map(function(allLoadingStates) {
4062
4083
  var firstErrorState = allLoadingStates.find(function(x) {
@@ -4086,6 +4107,8 @@ function startWithBeginLoading(state) {
4086
4107
  *
4087
4108
  * Unlike {@link valueFromLoadingState}, this operator emits for every state change, regardless of whether the value is defined.
4088
4109
  *
4110
+ * @returns An `OperatorFunction` that maps each {@link LoadingState} to its current value (or undefined).
4111
+ *
4089
4112
  * @example
4090
4113
  * ```ts
4091
4114
  * // Expose the current (possibly undefined) value from a loading state
@@ -4094,8 +4117,6 @@ function startWithBeginLoading(state) {
4094
4117
  * shareReplay(1)
4095
4118
  * );
4096
4119
  * ```
4097
- *
4098
- * @returns An `OperatorFunction` that maps each {@link LoadingState} to its current value (or undefined).
4099
4120
  */ function currentValueFromLoadingState() {
4100
4121
  return function(obs) {
4101
4122
  return obs.pipe(rxjs.map(function(x) {
@@ -4109,6 +4130,8 @@ function startWithBeginLoading(state) {
4109
4130
  * Equivalent to piping {@link currentValueFromLoadingState} and `filterMaybeStrict()`.
4110
4131
  * Only emits when the value is defined, filtering out loading and error states without values.
4111
4132
  *
4133
+ * @returns An `OperatorFunction` that emits only defined values from the {@link LoadingState}.
4134
+ *
4112
4135
  * @example
4113
4136
  * ```ts
4114
4137
  * // Only emit when the loading state has a defined value
@@ -4117,8 +4140,6 @@ function startWithBeginLoading(state) {
4117
4140
  * // only emits non-null/non-undefined values
4118
4141
  * );
4119
4142
  * ```
4120
- *
4121
- * @returns An `OperatorFunction` that emits only defined values from the {@link LoadingState}.
4122
4143
  */ function valueFromLoadingState() {
4123
4144
  return function(obs) {
4124
4145
  return obs.pipe(rxjs.map(function(x) {
@@ -4131,6 +4152,8 @@ function startWithBeginLoading(state) {
4131
4152
  *
4132
4153
  * Filters to only emit when the state contains an error, then extracts and emits the {@link ReadableError}.
4133
4154
  *
4155
+ * @returns An `OperatorFunction` that emits the {@link ReadableError} from error states.
4156
+ *
4134
4157
  * @example
4135
4158
  * ```ts
4136
4159
  * // React to errors from a loading state
@@ -4139,8 +4162,6 @@ function startWithBeginLoading(state) {
4139
4162
  * tap((error) => console.error('Loading failed:', error))
4140
4163
  * ).subscribe();
4141
4164
  * ```
4142
- *
4143
- * @returns An `OperatorFunction` that emits the {@link ReadableError} from error states.
4144
4165
  */ function errorFromLoadingState() {
4145
4166
  return function(obs) {
4146
4167
  return obs.pipe(rxjs.filter(isLoadingStateWithError), rxjs.map(function(x) {
@@ -4154,6 +4175,8 @@ function startWithBeginLoading(state) {
4154
4175
  * Passes through non-error states unchanged, but throws the error from any {@link LoadingStateWithError},
4155
4176
  * converting the loading state error into an observable error that can be caught with `catchError`.
4156
4177
  *
4178
+ * @returns An `OperatorFunction` that passes through non-error states and throws on error states.
4179
+ *
4157
4180
  * @example
4158
4181
  * ```ts
4159
4182
  * // Convert a LoadingState observable to a Promise, throwing on error states
@@ -4164,8 +4187,6 @@ function startWithBeginLoading(state) {
4164
4187
  * )
4165
4188
  * );
4166
4189
  * ```
4167
- *
4168
- * @returns An `OperatorFunction` that passes through non-error states and throws on error states.
4169
4190
  */ function throwErrorFromLoadingStateError() {
4170
4191
  return function(obs) {
4171
4192
  return obs.pipe(rxjs.map(function(x) {
@@ -4248,6 +4269,8 @@ function catchLoadingStateErrorWithOperator(operator) {
4248
4269
  if (isLoadingStateWithError(state)) {
4249
4270
  // map the value using the error state
4250
4271
  mappedObs = rxjs.of(state).pipe(operator, // if the operator does not return nearly instantly, then return the current state, minus a value
4272
+ // TODO(breaking-change): consider tightening this operator's generic constraints (or accepting Partial<L> for the placeholder) so the structural spread can satisfy L without the double cast.
4273
+ // TODO: Fix eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- L is a generic Partial<PageLoadingState> subtype; the spread literal cannot structurally satisfy that intersection without this cast
4251
4274
  timeoutStartWith(_object_spread_props$5(_object_spread$5({}, state), {
4252
4275
  loading: true,
4253
4276
  value: undefined
@@ -4310,6 +4333,9 @@ function distinctLoadingState(inputConfig) {
4310
4333
  * Waits for the first finished loading state, then resolves with the value. If the finished state
4311
4334
  * contains an error, the promise is rejected with that error.
4312
4335
  *
4336
+ * @param obs - The observable emitting {@link LoadingState} values.
4337
+ * @returns Resolves with the first finished value or rejects when the finished state carries an error.
4338
+ *
4313
4339
  * @example
4314
4340
  * ```ts
4315
4341
  * // Await a loading state observable as a promise
@@ -4326,9 +4352,6 @@ function distinctLoadingState(inputConfig) {
4326
4352
  * throw e;
4327
4353
  * });
4328
4354
  * ```
4329
- *
4330
- * @param obs - The observable emitting {@link LoadingState} values.
4331
- * @returns A Promise that resolves with the value or rejects with the error.
4332
4355
  */ function promiseFromLoadingState(obs) {
4333
4356
  return rxjs.firstValueFrom(obs.pipe(rxjs.filter(isLoadingStateFinishedLoading))).then(function(x) {
4334
4357
  var result;
@@ -4347,9 +4370,9 @@ function distinctLoadingState(inputConfig) {
4347
4370
  * Determines the `loading` flag based on whether an error is present, whether the value is defined,
4348
4371
  * and the `showLoadingOnUndefinedValue` setting. Loading progress is only included while loading.
4349
4372
  *
4350
- * @param state - the current loading state to convert into a context event
4351
- * @param input - configuration input controlling how the loading flag is derived
4352
- * @returns a loading state context event derived from the given state
4373
+ * @param state - The current loading state to convert into a context event.
4374
+ * @param input - Configuration input controlling how the loading flag is derived.
4375
+ * @returns A loading state context event derived from the given state.
4353
4376
  */ var DEFAULT_LOADING_EVENT_FOR_LOADING_PAIR_FUNCTION = function DEFAULT_LOADING_EVENT_FOR_LOADING_PAIR_FUNCTION(state, input) {
4354
4377
  var showLoadingOnUndefinedValue = input.showLoadingOnUndefinedValue;
4355
4378
  var error = state.error, value = state.value, loadingProgress = state.loadingProgress;
@@ -4375,6 +4398,9 @@ function distinctLoadingState(inputConfig) {
4375
4398
  * Accepts either a raw observable or a {@link LoadingStateContextConfig} for fine-grained control
4376
4399
  * over how loading events are derived from the state.
4377
4400
  *
4401
+ * @param input - Optional observable or config to initialize the context.
4402
+ * @returns A mutable loading state context with reactive accessors.
4403
+ *
4378
4404
  * @example
4379
4405
  * ```ts
4380
4406
  * // Create a context from a state observable
@@ -4392,9 +4418,6 @@ function distinctLoadingState(inputConfig) {
4392
4418
  * // Clean up
4393
4419
  * context.destroy();
4394
4420
  * ```
4395
- *
4396
- * @param input - optional observable or config to initialize the context
4397
- * @returns a mutable loading state context with reactive accessors
4398
4421
  */ function loadingStateContext(input) {
4399
4422
  var _ref, _ref1;
4400
4423
  var _config = input && rxjs.isObservable(input) ? {
@@ -4454,15 +4477,15 @@ function distinctLoadingState(inputConfig) {
4454
4477
  *
4455
4478
  * Returns true if the value is nullish or has zero length, regardless of loading status.
4456
4479
  *
4480
+ * @param listLoadingState - The list loading state to check.
4481
+ * @returns True if the value is empty or absent.
4482
+ *
4457
4483
  * @example
4458
4484
  * ```ts
4459
4485
  * isListLoadingStateWithEmptyValue(successResult([])); // true
4460
4486
  * isListLoadingStateWithEmptyValue(successResult([1, 2])); // false
4461
4487
  * isListLoadingStateWithEmptyValue(beginLoading()); // true (no value)
4462
4488
  * ```
4463
- *
4464
- * @param listLoadingState - the list loading state to check
4465
- * @returns true if the value is empty or absent
4466
4489
  */ function isListLoadingStateWithEmptyValue(listLoadingState) {
4467
4490
  var _listLoadingState_value;
4468
4491
  return Boolean(!((_listLoadingState_value = listLoadingState.value) === null || _listLoadingState_value === void 0 ? void 0 : _listLoadingState_value.length));
@@ -4470,14 +4493,14 @@ function distinctLoadingState(inputConfig) {
4470
4493
  /**
4471
4494
  * RxJS operator that maps each emitted {@link ListLoadingState} to a boolean indicating whether the list is empty.
4472
4495
  *
4496
+ * @returns An operator that emits true when the list value is empty or absent.
4497
+ *
4473
4498
  * @example
4474
4499
  * ```ts
4475
4500
  * of(successResult([])).pipe(
4476
4501
  * mapIsListLoadingStateWithEmptyValue()
4477
4502
  * ).subscribe((isEmpty) => console.log(isEmpty)); // true
4478
4503
  * ```
4479
- *
4480
- * @returns an operator that emits true when the list value is empty or absent
4481
4504
  */ function mapIsListLoadingStateWithEmptyValue() {
4482
4505
  return rxjs.map(isListLoadingStateWithEmptyValue);
4483
4506
  }
@@ -4486,16 +4509,16 @@ function distinctLoadingState(inputConfig) {
4486
4509
  *
4487
4510
  * Uses {@link loadingStateFromObs} internally and attaches the page number to each emitted state.
4488
4511
  *
4512
+ * @param obs - The source observable to wrap.
4513
+ * @param firstOnly - If true, only takes the first value.
4514
+ * @param page - The page number to attach (defaults to 0)
4515
+ * @returns An observable of page loading states.
4516
+ *
4489
4517
  * @example
4490
4518
  * ```ts
4491
4519
  * const pageState$ = pageLoadingStateFromObs(fetchItems$, false, 2);
4492
4520
  * // emits: { loading: true, page: 2 }, then { value: items, loading: false, page: 2 }
4493
4521
  * ```
4494
- *
4495
- * @param obs - the source observable to wrap
4496
- * @param firstOnly - if true, only takes the first value
4497
- * @param page - the page number to attach (defaults to 0)
4498
- * @returns an observable of page loading states
4499
4522
  */ function pageLoadingStateFromObs(obs, firstOnly) {
4500
4523
  var page = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
4501
4524
  return loadingStateFromObs(obs, firstOnly).pipe(rxjs.map(function(x) {
@@ -4509,6 +4532,8 @@ function distinctLoadingState(inputConfig) {
4509
4532
  *
4510
4533
  * Combines {@link valueFromFinishedLoadingState} with a default of `[]`.
4511
4534
  *
4535
+ * @returns An operator that emits the array value or an empty array.
4536
+ *
4512
4537
  * @example
4513
4538
  * ```ts
4514
4539
  * of(successResult([1, 2, 3])).pipe(
@@ -4519,8 +4544,6 @@ function distinctLoadingState(inputConfig) {
4519
4544
  * arrayValueFromFinishedLoadingState()
4520
4545
  * ).subscribe((items) => console.log(items)); // []
4521
4546
  * ```
4522
- *
4523
- * @returns an operator that emits the array value or an empty array
4524
4547
  */ function arrayValueFromFinishedLoadingState() {
4525
4548
  return function(obs) {
4526
4549
  return obs.pipe(valueFromFinishedLoadingState(function() {
@@ -4587,6 +4610,9 @@ function _type_of$2(obj) {
4587
4610
  * Extends {@link loadingStateContext} with list-aware behavior, including optional array length limiting
4588
4611
  * via {@link LimitArrayConfig} and empty-state detection streams.
4589
4612
  *
4613
+ * @param input - Optional observable or config to initialize the context.
4614
+ * @returns A mutable list loading state context.
4615
+ *
4590
4616
  * @example
4591
4617
  * ```ts
4592
4618
  * const context = listLoadingStateContext<string>();
@@ -4604,9 +4630,6 @@ function _type_of$2(obj) {
4604
4630
  *
4605
4631
  * context.destroy();
4606
4632
  * ```
4607
- *
4608
- * @param input - optional observable or config to initialize the context
4609
- * @returns a mutable list loading state context
4610
4633
  */ function listLoadingStateContext(input) {
4611
4634
  var limitArrayConfig = (typeof input === "undefined" ? "undefined" : _type_of$2(input)) === 'object' ? input : undefined;
4612
4635
  var loadingState = loadingStateContext(_object_spread_props$4(_object_spread$4({}, input), {
@@ -4748,7 +4771,7 @@ function _object_spread_props$3(target, source) {
4748
4771
  /**
4749
4772
  * Whether the current state has a non-null error.
4750
4773
  *
4751
- * @returns true if the current state contains an error
4774
+ * @returns True if the current state contains an error.
4752
4775
  */ key: "hasError",
4753
4776
  value: function hasError() {
4754
4777
  return isLoadingStateWithError(this._subject.value);
@@ -4776,7 +4799,7 @@ function _object_spread_props$3(target, source) {
4776
4799
  /**
4777
4800
  * Sets the loading flag and clears any existing error.
4778
4801
  *
4779
- * @param loading - whether loading is in progress (defaults to true)
4802
+ * @param loading - Whether loading is in progress (defaults to true)
4780
4803
  */ key: "setLoading",
4781
4804
  value: function setLoading() {
4782
4805
  var loading = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
@@ -4790,8 +4813,8 @@ function _object_spread_props$3(target, source) {
4790
4813
  /**
4791
4814
  * Sets an error state with an optional loading flag.
4792
4815
  *
4793
- * @param error - the error to set
4794
- * @param loading - whether loading is still in progress (defaults to false)
4816
+ * @param error - The error to set.
4817
+ * @param loading - Whether loading is still in progress (defaults to false)
4795
4818
  */ key: "setError",
4796
4819
  value: function setError(error) {
4797
4820
  var loading = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
@@ -5191,10 +5214,9 @@ function itemAccumulator(itemIteration, inputMapItem) {
5191
5214
  * Automatically pages through an accumulator's iteration until the desired number of results
5192
5215
  * is reached or no more pages are available.
5193
5216
  *
5194
- * @param config - configuration specifying the accumulator, result limit, and counting function
5195
- * @returns promise resolving to the final page number and total results count
5196
- *
5197
- * @throws Rejects if the iteration encounters an error during loading
5217
+ * @param config - Configuration specifying the accumulator, result limit, and counting function.
5218
+ * @returns Promise resolving to the final page number and total results count.
5219
+ * @throws {Error} Rejects if the iteration encounters a loading error.
5198
5220
  */ function itemAccumulatorNextPageUntilResultsCount(config) {
5199
5221
  var accumulator = config.accumulator, maxResultsLimit = config.maxResultsLimit, countResults = config.countResultsFunction;
5200
5222
  var getMaxResultsLimit = util.asGetter(maxResultsLimit);
@@ -5343,8 +5365,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
5343
5365
  * Designed for accumulators where each page returns an array of items. Concatenates all
5344
5366
  * page results into one flat array that grows as new pages are loaded.
5345
5367
  *
5346
- * @param accumulator - accumulator whose page results are arrays to flatten
5347
- * @returns observable emitting the flattened array of all accumulated items
5368
+ * @param accumulator - Accumulator whose page results are arrays to flatten.
5369
+ * @returns Observable emitting the flattened array of all accumulated items.
5348
5370
  */ function flattenAccumulatorResultItemArray(accumulator) {
5349
5371
  return accumulator.currentAllItemPairs$.pipe(scanBuildArray(function(allItems) {
5350
5372
  var pairs = allItems;
@@ -5371,8 +5393,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
5371
5393
  * The loading state reflects whether a page is currently being fetched, while the value
5372
5394
  * always contains the full flattened array of all items loaded so far.
5373
5395
  *
5374
- * @param accumulator - page accumulator whose results are arrays to flatten
5375
- * @returns observable of the combined loading state with all accumulated items
5396
+ * @param accumulator - Page accumulator whose results are arrays to flatten.
5397
+ * @returns Observable of the combined loading state with all accumulated items.
5376
5398
  */ function accumulatorFlattenPageListLoadingState(accumulator) {
5377
5399
  return rxjs.combineLatest([
5378
5400
  accumulator.itemIteration.currentState$,
@@ -5394,8 +5416,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
5394
5416
  * Unlike {@link accumulatorFlattenPageListLoadingState}, this does not flatten arrays —
5395
5417
  * each accumulated value is included as-is.
5396
5418
  *
5397
- * @param accumulator - page accumulator to observe
5398
- * @returns observable of the combined loading state with all accumulated items
5419
+ * @param accumulator - Page accumulator to observe.
5420
+ * @returns Observable of the combined loading state with all accumulated items.
5399
5421
  */ function accumulatorCurrentPageListLoadingState(accumulator) {
5400
5422
  return rxjs.combineLatest([
5401
5423
  accumulator.itemIteration.currentState$,
@@ -5413,8 +5435,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
5413
5435
  /**
5414
5436
  * Returns the latest loaded page number from the input accumulator's underlying iteration.
5415
5437
  *
5416
- * @param pageItemAccumulator - accumulator to observe the current page from
5417
- * @returns observable emitting the most recently loaded page number
5438
+ * @param pageItemAccumulator - Accumulator to observe the current page from.
5439
+ * @returns Observable emitting the most recently loaded page number.
5418
5440
  */ function pageItemAccumulatorCurrentPage(pageItemAccumulator) {
5419
5441
  return pageItemAccumulator.itemIteration.latestLoadedPage$;
5420
5442
  }
@@ -5425,9 +5447,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
5425
5447
  *
5426
5448
  * Control flow (next, hasNext, canLoadMore) is delegated directly to the underlying iteration.
5427
5449
  *
5428
- * @param itemIterator - the source iteration to wrap
5429
- * @param config - mapping configuration for transforming loading state values
5430
- * @returns mapped iteration instance with transformed state observables
5450
+ * @param itemIterator - The source iteration to wrap.
5451
+ * @param config - Mapping configuration for transforming loading state values.
5452
+ * @returns Mapped iteration instance with transformed state observables.
5431
5453
  */ function mapItemIteration(itemIterator, config) {
5432
5454
  var hasNext$ = itemIterator.hasNext$;
5433
5455
  var canLoadMore$ = itemIterator.canLoadMore$;
@@ -5514,9 +5536,9 @@ function _object_spread_props$2(target, source) {
5514
5536
  * and transforms its loading state values while preserving page-level operations
5515
5537
  * (nextPage, page load limits, latestLoadedPage).
5516
5538
  *
5517
- * @param itemIteration - the source page iteration to wrap
5518
- * @param config - mapping configuration for transforming loading state values
5519
- * @returns mapped page iteration instance
5539
+ * @param itemIteration - The source page iteration to wrap.
5540
+ * @param config - Mapping configuration for transforming loading state values.
5541
+ * @returns Mapped page iteration instance.
5520
5542
  */ function mappedPageItemIteration(itemIteration, config) {
5521
5543
  function nextPage(request) {
5522
5544
  return itemIteration.nextPage(request);
@@ -5701,8 +5723,8 @@ function _unsupported_iterable_to_array(o, minLen) {
5701
5723
  /**
5702
5724
  * Creates a new iteration instance with the given configuration.
5703
5725
  *
5704
- * @param config - filter and page limit configuration for this iteration session
5705
- * @returns new iteration instance ready to begin loading pages
5726
+ * @param config - Filter and page limit configuration for this iteration session.
5727
+ * @returns New iteration instance ready to begin loading pages.
5706
5728
  */ key: "instance",
5707
5729
  value: function instance(config) {
5708
5730
  return new ItemPageIterationInstance(this, config);
@@ -5743,6 +5765,7 @@ function _unsupported_iterable_to_array(o, minLen) {
5743
5765
  ];
5744
5766
  }), rxjs.mergeMap(function(param) {
5745
5767
  var _param = _sliced_to_array(param, 2), shouldLoadNextPage = _param[0], prevResult = _param[1];
5768
+ var outputObs;
5746
5769
  if (shouldLoadNextPage) {
5747
5770
  var nextPageNumber = nextIteratorPageNumber(prevResult); // retry number if error occured
5748
5771
  var page = util.filteredPage(nextPageNumber, _this._config);
@@ -5758,19 +5781,24 @@ function _unsupported_iterable_to_array(o, minLen) {
5758
5781
  }).pipe(rxjs.first());
5759
5782
  }));
5760
5783
  var stateObs = iteratorResultObs.pipe(rxjs.first(), rxjs.map(function(result) {
5761
- if (result.error != null) {
5762
- return {
5784
+ var mappedState;
5785
+ if (result.error == null) {
5786
+ mappedState = successPageResult(nextPageNumber, result);
5787
+ } else {
5788
+ mappedState = {
5763
5789
  loading: false,
5764
5790
  page: nextPageNumber,
5765
5791
  error: result.error,
5766
5792
  value: result
5767
5793
  };
5768
5794
  }
5769
- return successPageResult(nextPageNumber, result);
5795
+ return mappedState;
5770
5796
  }), startWithBeginLoading(page), rxjs.shareReplay(1));
5771
- return stateObs;
5797
+ outputObs = stateObs;
5798
+ } else {
5799
+ outputObs = rxjs.of(prevResult).pipe();
5772
5800
  }
5773
- return rxjs.of(prevResult).pipe();
5801
+ return outputObs;
5774
5802
  }), rxjs.map(function(inputState) {
5775
5803
  var state;
5776
5804
  if (inputState != null) {
@@ -6009,16 +6037,18 @@ function _unsupported_iterable_to_array(o, minLen) {
6009
6037
  * - `end` is not explicitly `false` and the result value is empty/null (via `hasValueOrNotEmpty`)
6010
6038
  * - Error results are never considered the end
6011
6039
  *
6012
- * @param result - the page result to check
6013
- * @returns `true` if this result indicates no more pages are available
6040
+ * @param result - The page result to check.
6041
+ * @returns `true` if this result indicates no more pages are available.
6014
6042
  */ function isItemPageIteratorResultEndResult(result) {
6043
+ var isEnd;
6015
6044
  if (result.error != null) {
6016
- return false;
6017
- }
6018
- if (result.end != null) {
6019
- return result.end;
6045
+ isEnd = false;
6046
+ } else if (result.end == null) {
6047
+ isEnd = !util.hasValueOrNotEmpty(result);
6048
+ } else {
6049
+ isEnd = result.end;
6020
6050
  }
6021
- return !util.hasValueOrNotEmpty(result);
6051
+ return isEnd;
6022
6052
  }
6023
6053
  function itemPageIteratorShouldLoadNextPage(request, hasNextAndCanLoadMore, prevResult) {
6024
6054
  return hasNextAndCanLoadMore && // Must be able to load more
@@ -6033,6 +6063,8 @@ function mapItemPageLoadingStateFromResultPageLoadingState() {
6033
6063
  }
6034
6064
  function itemPageLoadingStateFromResultPageLoadingState(input) {
6035
6065
  var _input_value;
6066
+ // TODO(breaking-change): refactor to build the result as an object literal so mapValue narrows V and hasNextPage can be assigned without the cast. See https://github.com/dereekb/dbx-components issue tracking for cleanup.
6067
+ // TODO: Fix eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- cast widens mapValue's V|undefined inference to V and removes readonly so hasNextPage can be assigned; tsc reports both errors without it
6036
6068
  var result = mapLoadingStateResults(input, {
6037
6069
  mapValue: function mapValue(result) {
6038
6070
  return result.value;
@@ -6119,12 +6151,12 @@ function _type_of(obj) {
6119
6151
  *
6120
6152
  * Useful for deferring an action until all locks are released, with a safety timeout to avoid waiting indefinitely.
6121
6153
  *
6122
- * @param config - configuration specifying the lock set, callback, timeout, and optional delay
6123
- * @param config.lockSet - the lock set to monitor for the next unlock event
6124
- * @param config.fn - optional callback to invoke when the lock set unlocks or the timeout is reached
6125
- * @param config.timeout - maximum time in milliseconds to wait before timing out
6126
- * @param config.delayTime - optional delay in milliseconds after unlock before invoking the callback
6127
- * @returns subscription that can be unsubscribed to cancel the wait
6154
+ * @param config - Configuration specifying the lock set, callback, timeout, and optional delay.
6155
+ * @param config.lockSet - The lock set to monitor for the next unlock event.
6156
+ * @param config.fn - Optional callback to invoke when the lock set unlocks or the timeout is reached.
6157
+ * @param config.timeout - Maximum time in milliseconds to wait before timing out.
6158
+ * @param config.delayTime - Optional delay in milliseconds after unlock before invoking the callback.
6159
+ * @returns Subscription that can be unsubscribed to cancel the wait.
6128
6160
  *
6129
6161
  * @example
6130
6162
  * ```ts
@@ -6242,7 +6274,7 @@ function _type_of(obj) {
6242
6274
  /**
6243
6275
  * Locks for a specified number of seconds using the default time lock key.
6244
6276
  *
6245
- * @param seconds - duration in seconds
6277
+ * @param seconds - Duration in seconds.
6246
6278
  */ key: "lockForSeconds",
6247
6279
  value: function lockForSeconds(seconds) {
6248
6280
  this.lockForTime(seconds * 1000);
@@ -6252,8 +6284,8 @@ function _type_of(obj) {
6252
6284
  /**
6253
6285
  * Locks for a specified duration in milliseconds, automatically unlocking when the time elapses.
6254
6286
  *
6255
- * @param milliseconds - lock duration
6256
- * @param key - optional lock key, defaults to {@link DEFAULT_LOCK_SET_TIME_LOCK_KEY}
6287
+ * @param milliseconds - Lock duration.
6288
+ * @param key - Optional lock key, defaults to {@link DEFAULT_LOCK_SET_TIME_LOCK_KEY}
6257
6289
  */ key: "lockForTime",
6258
6290
  value: function lockForTime(milliseconds, key) {
6259
6291
  this.addLock(key !== null && key !== void 0 ? key : DEFAULT_LOCK_SET_TIME_LOCK_KEY, rxjs.of(false).pipe(rxjs.delay(milliseconds), rxjs.startWith(true)));
@@ -6264,9 +6296,9 @@ function _type_of(obj) {
6264
6296
  * Registers a lock observable under the given key. The lock is considered active when
6265
6297
  * the observable emits `true`. Empty observables are treated as unlocked.
6266
6298
  *
6267
- * @param key - identifier for this lock
6268
- * @param obs - observable that emits the lock state
6269
- * @returns function that removes this specific lock when called
6299
+ * @param key - Identifier for this lock.
6300
+ * @param obs - Observable that emits the lock state.
6301
+ * @returns Function that removes this specific lock when called.
6270
6302
  *
6271
6303
  * @example
6272
6304
  * ```ts
@@ -6302,7 +6334,7 @@ function _type_of(obj) {
6302
6334
  /**
6303
6335
  * Removes the lock registered under the given key, if it exists.
6304
6336
  *
6305
- * @param key - identifier of the lock to remove
6337
+ * @param key - Identifier of the lock to remove.
6306
6338
  */ key: "removeLock",
6307
6339
  value: function removeLock(key) {
6308
6340
  if (this._locks.value.delete(key)) {
@@ -6314,9 +6346,9 @@ function _type_of(obj) {
6314
6346
  /**
6315
6347
  * Registers a callback for the next time this lock set becomes unlocked.
6316
6348
  *
6317
- * @param config - callback function or configuration object
6318
- * @param delayTime - optional delay in milliseconds after unlock before invoking the callback
6319
- * @returns subscription that can be unsubscribed to cancel the wait
6349
+ * @param config - Callback function or configuration object.
6350
+ * @param delayTime - Optional delay in milliseconds after unlock before invoking the callback.
6351
+ * @returns Subscription that can be unsubscribed to cancel the wait.
6320
6352
  */ key: "onNextUnlock",
6321
6353
  value: function onNextUnlock(config, delayTime) {
6322
6354
  return onLockSetNextUnlock(_object_spread({
@@ -6332,7 +6364,7 @@ function _type_of(obj) {
6332
6364
  * Establishes a parent-child relationship where this lock set's locked state is propagated
6333
6365
  * to the parent. When this lock set is locked, the parent will also reflect a locked state.
6334
6366
  *
6335
- * @param parent - parent lock set or observable of one; pass `undefined` to detach
6367
+ * @param parent - Parent lock set or observable of one; pass `undefined` to detach.
6336
6368
  */ key: "setParentLockSet",
6337
6369
  value: function setParentLockSet(parent) {
6338
6370
  var _this = this;
@@ -6351,9 +6383,9 @@ function _type_of(obj) {
6351
6383
  /**
6352
6384
  * Registers a child lock set so its locked state propagates upward to this lock set.
6353
6385
  *
6354
- * @param lockSet - child lock set to monitor
6355
- * @param key - optional lock key, auto-generated if not provided
6356
- * @returns function that removes the child lock relationship when called
6386
+ * @param lockSet - Child lock set to monitor.
6387
+ * @param key - Optional lock key, auto-generated if not provided.
6388
+ * @returns Function that removes the child lock relationship when called.
6357
6389
  */ key: "addChildLockSet",
6358
6390
  value: function addChildLockSet(lockSet) {
6359
6391
  var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "".concat(LockSet.LOCK_SET_CHILD_INDEX_STEPPER++);
@@ -6374,8 +6406,8 @@ function _type_of(obj) {
6374
6406
  * After the unlock event (or timeout), the optional callback is invoked and then
6375
6407
  * {@link destroy} is called after a short delay.
6376
6408
  *
6377
- * @param config - optional callback or configuration for the unlock wait
6378
- * @param delayTime - optional delay in milliseconds after unlock before invoking the callback
6409
+ * @param config - Optional callback or configuration for the unlock wait.
6410
+ * @param delayTime - Optional delay in milliseconds after unlock before invoking the callback.
6379
6411
  */ key: "destroyOnNextUnlock",
6380
6412
  value: function destroyOnNextUnlock(config, delayTime) {
6381
6413
  var _this = this;
@@ -6549,7 +6581,7 @@ function _define_property(obj, key, value) {
6549
6581
  *
6550
6582
  * If the loading state returns an error, the error is forwarded.
6551
6583
  *
6552
- * @param loadingStateObs - observable of the loading state to track as the work result
6584
+ * @param loadingStateObs - Observable of the loading state to track as the work result.
6553
6585
  */ key: "startWorkingWithLoadingStateObservable",
6554
6586
  value: function startWorkingWithLoadingStateObservable(loadingStateObs) {
6555
6587
  var _this = this;
@@ -6575,8 +6607,8 @@ function _define_property(obj, key, value) {
6575
6607
  *
6576
6608
  * It is used in conjunction with startWorking() and ideal for cases where multiple observables or promises are used.
6577
6609
  *
6578
- * @param loadingStateObs - promise or observable of the loading state to track for errors
6579
- * @returns a promise that resolves with the value from the loading state or rejects on error
6610
+ * @param loadingStateObs - Promise or observable of the loading state to track for errors.
6611
+ * @returns Resolves with the first non-loading value, or rejects when the loading state surfaces an error.
6580
6612
  */ key: "performTaskWithLoadingState",
6581
6613
  value: function performTaskWithLoadingState(loadingStateObs) {
6582
6614
  var _this = this;
@@ -6595,7 +6627,8 @@ function _define_property(obj, key, value) {
6595
6627
  *
6596
6628
  * If an error is thrown, the error is forwarded to the reject function.
6597
6629
  *
6598
- * @param fn - synchronous function that returns the result value or throws an error
6630
+ * @param fn - Synchronous function that returns the result value or throws an error.
6631
+ * @throws Re-throws the error from `fn` after forwarding it to the reject function.
6599
6632
  */ key: "performTaskWithReturnValue",
6600
6633
  value: function performTaskWithReturnValue(fn) {
6601
6634
  try {
@@ -6611,7 +6644,7 @@ function _define_property(obj, key, value) {
6611
6644
  /**
6612
6645
  * Begins working using a promise.
6613
6646
  *
6614
- * @param promise - the promise that represents the asynchronous work
6647
+ * @param promise - Asynchronous work whose resolved value should be tracked as the work result.
6615
6648
  */ key: "startWorkingWithPromise",
6616
6649
  value: function startWorkingWithPromise(promise) {
6617
6650
  this.startWorkingWithObservable(rxjs.from(promise));
@@ -6621,7 +6654,7 @@ function _define_property(obj, key, value) {
6621
6654
  /**
6622
6655
  * Begins working using an observable.
6623
6656
  *
6624
- * @param workObs - the observable that represents the asynchronous work and emits the result
6657
+ * @param workObs - The observable that represents the asynchronous work and emits the result.
6625
6658
  */ key: "startWorkingWithObservable",
6626
6659
  value: function startWorkingWithObservable(workObs) {
6627
6660
  var _this = this;
@@ -6649,7 +6682,7 @@ function _define_property(obj, key, value) {
6649
6682
  /**
6650
6683
  * Sets success on the work.
6651
6684
  *
6652
- * @param result - the successful result value to pass to the delegate
6685
+ * @param result - The successful result value to pass to the delegate.
6653
6686
  */ key: "success",
6654
6687
  value: function success(result) {
6655
6688
  this._setComplete(successResult(result));
@@ -6660,7 +6693,7 @@ function _define_property(obj, key, value) {
6660
6693
  /**
6661
6694
  * Sets rejected on the work.
6662
6695
  *
6663
- * @param error - the error to pass to the delegate as the rejection reason
6696
+ * @param error - The error to pass to the delegate as the rejection reason.
6664
6697
  */ key: "reject",
6665
6698
  value: function reject(error) {
6666
6699
  this._setComplete(errorResult(error));
@@ -6710,6 +6743,11 @@ function _define_property(obj, key, value) {
6710
6743
  * If the work function returns an observable, it is automatically subscribed to. If it uses
6711
6744
  * the handler directly, the observable return is ignored.
6712
6745
  *
6746
+ * @param config - Work function and delegate configuration.
6747
+ * @param config.work - The work function to execute for each input value.
6748
+ * @param config.delegate - Delegate that receives lifecycle callbacks (start, success, reject)
6749
+ * @returns A factory function that creates WorkInstance for each input.
6750
+ *
6713
6751
  * @example
6714
6752
  * ```ts
6715
6753
  * const factory = workFactory({
@@ -6721,38 +6759,36 @@ function _define_property(obj, key, value) {
6721
6759
  * // instance tracks the work lifecycle
6722
6760
  * ```
6723
6761
  *
6724
- * @param config - work function and delegate configuration
6725
- * @param config.work - the work function to execute for each input value
6726
- * @param config.delegate - delegate that receives lifecycle callbacks (start, success, reject)
6727
- * @returns a factory function that creates WorkInstance for each input
6728
6762
  * @__NO_SIDE_EFFECTS__
6729
6763
  */ function workFactory(param) {
6730
6764
  var work = param.work, delegate = param.delegate;
6731
6765
  return function(value) {
6732
6766
  var handler = new WorkInstance(value, delegate);
6733
- var fnResult;
6767
+ var fnResult = undefined;
6768
+ var result;
6734
6769
  try {
6735
6770
  fnResult = work(value, handler);
6771
+ result = handler;
6736
6772
  } catch (e) {
6737
6773
  console.error('Work encountered an unexpected error.', e);
6738
6774
  handler.reject(e);
6739
- return;
6740
6775
  }
6741
- if (!handler.isComplete && fnResult && rxjs.isObservable(fnResult)) {
6776
+ if (result != null && !handler.isComplete && fnResult && rxjs.isObservable(fnResult)) {
6742
6777
  if (handler.hasStarted) {
6743
6778
  throw new Error('Work already marked as begun from returned result. Either return an observable or use the handler directly.');
6744
6779
  }
6745
6780
  handler.startWorkingWithObservable(fnResult);
6746
6781
  }
6747
- return handler;
6782
+ return result;
6748
6783
  };
6749
6784
  }
6750
6785
  /**
6751
6786
  * Creates a {@link WorkFactory} that generates a new {@link WorkFactoryConfig} for each input,
6752
6787
  * enabling dynamic work and delegate selection per invocation.
6753
6788
  *
6754
- * @param configFactory - factory that produces work configuration from the input value
6755
- * @returns a work factory with per-invocation configuration
6789
+ * @param configFactory - Factory that produces work configuration from the input value.
6790
+ * @returns A work factory with per-invocation configuration.
6791
+ *
6756
6792
  * @__NO_SIDE_EFFECTS__
6757
6793
  */ function workFactoryForConfigFactory(configFactory) {
6758
6794
  return function(value) {