"use strict";exports.__esModule = true;exports.useEffectWithoutInitCall = void 0;
var _react = require("react");

var useEffectWithoutInitCall = exports.useEffectWithoutInitCall = function useEffectWithoutInitCall(effect, deps) {
  var isMountedRef = (0, _react.useRef)(false);

  (0, _react.useEffect)(function () {
    if (isMountedRef.current) {
      effect();
    }
  }, deps);

  (0, _react.useEffect)(function () {
    isMountedRef.current = true;
    return function () {
      isMountedRef.current = false;
    };
  }, []);
};