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/cjs/index.js CHANGED
@@ -7399,14 +7399,7 @@ var useItemInteraction = function useItemInteraction(interaction) {
7399
7399
  var setInteractions = recoil.useSetRecoilState(ItemInteractionsAtom);
7400
7400
  var register = React__default['default'].useCallback(function (callback) {
7401
7401
  setInteractions(function (prev) {
7402
- if (!prev[interaction]) {
7403
- // eslint-disable-next-line no-param-reassign
7404
- prev[interaction] = [];
7405
- }
7406
-
7407
- var newInter = _toConsumableArray(prev[interaction]);
7408
-
7409
- newInter.push(callback);
7402
+ var newInter = Array.isArray(prev[interaction]) ? [].concat(_toConsumableArray(prev[interaction]), [callback]) : [callback];
7410
7403
  return _objectSpread2(_objectSpread2({}, prev), {}, _defineProperty({}, interaction, newInter));
7411
7404
  });
7412
7405
  return function () {