import { useEffect, useRef, useCallback } from "react";

var useIsMounted = function useIsMounted() {
  var isMounted = useRef(true);
  useEffect(function () {
    return function () {
      isMounted.current = false;
    };
  }, []);
  return useCallback(function () {
    return isMounted.current;
  }, []);
};

export default useIsMounted;