@bigbinary/neeto-commons-frontend 2.0.82 → 2.0.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/react-utils.js CHANGED
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import React__default, { useEffect, useState, useDebugValue, useRef, useMemo } from 'react';
3
3
  import { Honeybadger, HoneybadgerErrorBoundary as HoneybadgerErrorBoundary$1 } from '@honeybadger-io/react';
4
4
  import { Typography, Button } from '@bigbinary/neetoui';
5
- import { isNil, includes, __, prop, toPairs, mergeLeft, isEmpty, omit, curry } from 'ramda';
5
+ import { isNil, includes, __, prop, toPairs, mergeLeft, isEmpty, omit, curry, keys } from 'ramda';
6
6
  import { useTranslation, Trans } from 'react-i18next';
7
7
  import ErrorPage from '@bigbinary/neeto-molecules/ErrorPage';
8
8
  import { Route, Redirect } from 'react-router-dom';
@@ -4673,14 +4673,11 @@ var setWithoutModifyingActions = function setWithoutModifyingActions(set) {
4673
4673
  return function (partial) {
4674
4674
  return set(function (previous) {
4675
4675
  if (typeof partial === "function") partial = partial(previous);
4676
- var isOverwritingActions = toPairs(partial).some(function (_ref) {
4677
- var _ref2 = _slicedToArray(_ref, 2),
4678
- key = _ref2[0],
4679
- value = _ref2[1];
4680
- return typeof (previous === null || previous === void 0 ? void 0 : previous[key]) === "function" && value !== previous[key];
4676
+ var overwrittenActions = keys(partial).filter(function (key) {
4677
+ return typeof (previous === null || previous === void 0 ? void 0 : previous[key]) === "function" && partial[key] !== previous[key];
4681
4678
  });
4682
- if (isOverwritingActions) {
4683
- throw new Error("Actions should not be modified");
4679
+ if (!isEmpty(overwrittenActions)) {
4680
+ throw new Error("Actions should not be modified. Touched action(s): ".concat(overwrittenActions.join(", ")));
4684
4681
  }
4685
4682
  return partial;
4686
4683
  }, false);