@dereekb/rxjs 13.14.0 → 13.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.cjs.js +12 -12
  2. package/index.esm.js +12 -12
  3. package/package.json +2 -2
package/index.cjs.js CHANGED
@@ -599,7 +599,7 @@ function asObservable(valueOrObs) {
599
599
  * @returns An operator that unwraps Maybe<ObservableOrValue> emissions.
600
600
  */ function maybeValueFromObservableOrValue() {
601
601
  return rxjs.switchMap(function(x) {
602
- return x != null ? asObservable(x) : rxjs.of(undefined);
602
+ return x == null ? rxjs.of(undefined) : asObservable(x);
603
603
  });
604
604
  }
605
605
  function asObservableFromGetter(input, args) {
@@ -622,7 +622,7 @@ function asObservableFromGetter(input, args) {
622
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
- return x != null ? asObservableFromGetter(x) : rxjs.of(undefined);
625
+ return x == null ? rxjs.of(undefined) : asObservableFromGetter(x);
626
626
  });
627
627
  }
628
628
  function useAsObservable(input, observer) {
@@ -762,7 +762,7 @@ function _unsupported_iterable_to_array$b(o, minLen) {
762
762
  * @returns An observable boolean indicating whether the value passes the check.
763
763
  */ function checkIs(isCheckFunction, value) {
764
764
  var defaultValueOnMaybe = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
765
- var is = isCheckFunction ? value != null ? isCheckFunction(value) : rxjs.of(defaultValueOnMaybe) : rxjs.of(true);
765
+ var is = isCheckFunction ? value == null ? rxjs.of(defaultValueOnMaybe) : isCheckFunction(value) : rxjs.of(true);
766
766
  return is;
767
767
  }
768
768
  // MARK: Filter
@@ -1351,7 +1351,7 @@ function _unsupported_iterable_to_array$9(o, minLen) {
1351
1351
  * Observable of the active filter value, resolving to the explicit filter if set,
1352
1352
  * otherwise falling back to the initial/default filter. Deduplicated by deep value equality.
1353
1353
  */ _define_property$b(this, "filter$", this._filter.pipe(rxjs.switchMap(function(x) {
1354
- return x != null ? rxjs.of(x) : _this.initialFilter$;
1354
+ return x == null ? _this.initialFilter$ : rxjs.of(x);
1355
1355
  }), filterMaybe(), distinctUntilObjectValuesChanged(), rxjs.shareReplay(1)));
1356
1356
  var _ref = config !== null && config !== void 0 ? config : {}, initWithFilter = _ref.initWithFilter, defaultFilter = _ref.defaultFilter, filter = _ref.filter;
1357
1357
  if (initWithFilter != null) {
@@ -3203,9 +3203,9 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3203
3203
  */ function errorOnEmissionsInPeriod(config) {
3204
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;
3205
3205
  var errorMessage = inputErrorMessage !== null && inputErrorMessage !== void 0 ? inputErrorMessage : 'errorOnEmissionsInPeriod(): Too many emissions in time period.';
3206
- var errorFactory = inputErrorFactory !== null && inputErrorFactory !== void 0 ? inputErrorFactory : !switchToObs ? function() {
3206
+ var errorFactory = inputErrorFactory !== null && inputErrorFactory !== void 0 ? inputErrorFactory : switchToObs ? undefined : function() {
3207
3207
  return new Error(errorMessage);
3208
- } : undefined;
3208
+ };
3209
3209
  return function(source) {
3210
3210
  var counter = util.timePeriodCounter(period);
3211
3211
  var result;
@@ -3309,7 +3309,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3309
3309
  var filterFactory = util.searchStringFilterFunction(filter);
3310
3310
  return rxjs.switchMap(function(values) {
3311
3311
  return search$.pipe(rxjs.map(function(search) {
3312
- return search != null ? filterFactory(search, values) : values;
3312
+ return search == null ? values : filterFactory(search, values);
3313
3313
  }));
3314
3314
  });
3315
3315
  }
@@ -3344,7 +3344,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3344
3344
  * ```
3345
3345
  */ function switchMapMaybeLoadingContextStream() {
3346
3346
  return rxjs.switchMap(function(x) {
3347
- return x != null ? x.stream$ : rxjs.of(undefined);
3347
+ return x == null ? rxjs.of(undefined) : x.stream$;
3348
3348
  });
3349
3349
  }
3350
3350
 
@@ -3904,12 +3904,12 @@ function mapLoadingStateResults(input, config) {
3904
3904
  value = inputValue;
3905
3905
  }
3906
3906
  var result;
3907
- if (!mapState) {
3907
+ if (mapState) {
3908
+ result = mapState(input, value);
3909
+ } else {
3908
3910
  result = _object_spread_props$6(_object_spread$6({}, input), {
3909
3911
  value: value
3910
3912
  });
3911
- } else {
3912
- result = mapState(input, value);
3913
3913
  }
3914
3914
  return result;
3915
3915
  }
@@ -5802,7 +5802,7 @@ function _unsupported_iterable_to_array(o, minLen) {
5802
5802
  }), rxjs.map(function(inputState) {
5803
5803
  var state;
5804
5804
  if (inputState != null) {
5805
- var end = inputState.value != null ? isItemPageIteratorResultEndResult(inputState.value) : undefined;
5805
+ var end = inputState.value == null ? undefined : isItemPageIteratorResultEndResult(inputState.value);
5806
5806
  var hasNextPage = util.invertMaybeBoolean(end);
5807
5807
  // Reuse the same reference when hasNextPage hasn't changed to avoid
5808
5808
  // tricking downstream distinctUntilChanged/scan into treating a
package/index.esm.js CHANGED
@@ -597,7 +597,7 @@ function asObservable(valueOrObs) {
597
597
  * @returns An operator that unwraps Maybe<ObservableOrValue> emissions.
598
598
  */ function maybeValueFromObservableOrValue() {
599
599
  return switchMap(function(x) {
600
- return x != null ? asObservable(x) : of(undefined);
600
+ return x == null ? of(undefined) : asObservable(x);
601
601
  });
602
602
  }
603
603
  function asObservableFromGetter(input, args) {
@@ -620,7 +620,7 @@ function asObservableFromGetter(input, args) {
620
620
  * @returns An operator that unwraps Maybe<ObservableOrValueGetter> emissions, emitting undefined for nullish inputs.
621
621
  */ function maybeValueFromObservableOrValueGetter() {
622
622
  return switchMap(function(x) {
623
- return x != null ? asObservableFromGetter(x) : of(undefined);
623
+ return x == null ? of(undefined) : asObservableFromGetter(x);
624
624
  });
625
625
  }
626
626
  function useAsObservable(input, observer) {
@@ -760,7 +760,7 @@ function _unsupported_iterable_to_array$b(o, minLen) {
760
760
  * @returns An observable boolean indicating whether the value passes the check.
761
761
  */ function checkIs(isCheckFunction, value) {
762
762
  var defaultValueOnMaybe = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
763
- var is = isCheckFunction ? value != null ? isCheckFunction(value) : of(defaultValueOnMaybe) : of(true);
763
+ var is = isCheckFunction ? value == null ? of(defaultValueOnMaybe) : isCheckFunction(value) : of(true);
764
764
  return is;
765
765
  }
766
766
  // MARK: Filter
@@ -1349,7 +1349,7 @@ function _unsupported_iterable_to_array$9(o, minLen) {
1349
1349
  * Observable of the active filter value, resolving to the explicit filter if set,
1350
1350
  * otherwise falling back to the initial/default filter. Deduplicated by deep value equality.
1351
1351
  */ _define_property$b(this, "filter$", this._filter.pipe(switchMap(function(x) {
1352
- return x != null ? of(x) : _this.initialFilter$;
1352
+ return x == null ? _this.initialFilter$ : of(x);
1353
1353
  }), filterMaybe(), distinctUntilObjectValuesChanged(), shareReplay(1)));
1354
1354
  var _ref = config !== null && config !== void 0 ? config : {}, initWithFilter = _ref.initWithFilter, defaultFilter = _ref.defaultFilter, filter = _ref.filter;
1355
1355
  if (initWithFilter != null) {
@@ -3201,9 +3201,9 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3201
3201
  */ function errorOnEmissionsInPeriod(config) {
3202
3202
  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;
3203
3203
  var errorMessage = inputErrorMessage !== null && inputErrorMessage !== void 0 ? inputErrorMessage : 'errorOnEmissionsInPeriod(): Too many emissions in time period.';
3204
- var errorFactory = inputErrorFactory !== null && inputErrorFactory !== void 0 ? inputErrorFactory : !switchToObs ? function() {
3204
+ var errorFactory = inputErrorFactory !== null && inputErrorFactory !== void 0 ? inputErrorFactory : switchToObs ? undefined : function() {
3205
3205
  return new Error(errorMessage);
3206
- } : undefined;
3206
+ };
3207
3207
  return function(source) {
3208
3208
  var counter = timePeriodCounter(period);
3209
3209
  var result;
@@ -3307,7 +3307,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3307
3307
  var filterFactory = searchStringFilterFunction(filter);
3308
3308
  return switchMap(function(values) {
3309
3309
  return search$.pipe(map(function(search) {
3310
- return search != null ? filterFactory(search, values) : values;
3310
+ return search == null ? values : filterFactory(search, values);
3311
3311
  }));
3312
3312
  });
3313
3313
  }
@@ -3342,7 +3342,7 @@ function _unsupported_iterable_to_array$5(o, minLen) {
3342
3342
  * ```
3343
3343
  */ function switchMapMaybeLoadingContextStream() {
3344
3344
  return switchMap(function(x) {
3345
- return x != null ? x.stream$ : of(undefined);
3345
+ return x == null ? of(undefined) : x.stream$;
3346
3346
  });
3347
3347
  }
3348
3348
 
@@ -3902,12 +3902,12 @@ function mapLoadingStateResults(input, config) {
3902
3902
  value = inputValue;
3903
3903
  }
3904
3904
  var result;
3905
- if (!mapState) {
3905
+ if (mapState) {
3906
+ result = mapState(input, value);
3907
+ } else {
3906
3908
  result = _object_spread_props$6(_object_spread$6({}, input), {
3907
3909
  value: value
3908
3910
  });
3909
- } else {
3910
- result = mapState(input, value);
3911
3911
  }
3912
3912
  return result;
3913
3913
  }
@@ -5800,7 +5800,7 @@ function _unsupported_iterable_to_array(o, minLen) {
5800
5800
  }), map(function(inputState) {
5801
5801
  var state;
5802
5802
  if (inputState != null) {
5803
- var end = inputState.value != null ? isItemPageIteratorResultEndResult(inputState.value) : undefined;
5803
+ var end = inputState.value == null ? undefined : isItemPageIteratorResultEndResult(inputState.value);
5804
5804
  var hasNextPage = invertMaybeBoolean(end);
5805
5805
  // Reuse the same reference when hasNextPage hasn't changed to avoid
5806
5806
  // tricking downstream distinctUntilChanged/scan into treating a
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dereekb/rxjs",
3
- "version": "13.14.0",
3
+ "version": "13.16.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "rxjs": "^7.8.2",
7
- "@dereekb/util": "13.14.0"
7
+ "@dereekb/util": "13.16.0"
8
8
  },
9
9
  "exports": {
10
10
  "./package.json": "./package.json",