function mergeRefs() {
  for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
    refs[_key] = arguments[_key];
  }
  return function (val) {
    setRefList.apply(void 0, [val].concat(refs));
  };
}
function setRefList(val) {
  for (var _len2 = arguments.length, refs = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
    refs[_key2 - 1] = arguments[_key2];
  }
  refs.forEach(function (ref) {
    if (typeof ref === 'function') {
      ref(val);
    }
    if (ref != null && typeof ref !== 'function') {
      ref.current = val;
    }
  });
}

export { mergeRefs, setRefList };
