import React from 'react';
function useFirstMountState() {
  var isFirst = React.useRef(true);
  if (isFirst.current) {
    isFirst.current = false;
    return true;
  }
  return isFirst.current;
}

/**
 * @description useUpdateEffect can be used to perform a side effect when the component updates, except when it's first mounted
 */
export var useUpdateEffect = function useUpdateEffect(effect, deps) {
  var isFirstMount = useFirstMountState();
  React.useEffect(function () {
    if (!isFirstMount) {
      return effect();
    }
  }, deps);
};
//# sourceMappingURL=useUpdateEffect.js.map