react-sync-board 0.5.1 → 0.5.2

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/dist/esm/index.js CHANGED
@@ -7391,14 +7391,7 @@ var useItemInteraction = function useItemInteraction(interaction) {
7391
7391
  var setInteractions = useSetRecoilState(ItemInteractionsAtom);
7392
7392
  var register = React.useCallback(function (callback) {
7393
7393
  setInteractions(function (prev) {
7394
- if (!prev[interaction]) {
7395
- // eslint-disable-next-line no-param-reassign
7396
- prev[interaction] = [];
7397
- }
7398
-
7399
- var newInter = _toConsumableArray(prev[interaction]);
7400
-
7401
- newInter.push(callback);
7394
+ var newInter = Array.isArray(prev[interaction]) ? [].concat(_toConsumableArray(prev[interaction]), [callback]) : [callback];
7402
7395
  return _objectSpread2(_objectSpread2({}, prev), {}, _defineProperty({}, interaction, newInter));
7403
7396
  });
7404
7397
  return function () {