"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useEffectCallOnlyAfterState = useEffectCallOnlyAfterState;

var _react = require("react");

function useEffectCallOnlyAfterState(callback) {
  var conditions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  var currentRef = (0, _react.useRef)(null);
  (0, _react.useEffect)(function () {
    if (!currentRef.current) {
      currentRef.current = true;
    } else if (currentRef.current) {
      callback && callback();
    }
  }, conditions);
}