import { useEffect } from "react";
import useMountedRef from "../useMountedRef";
export default (function (cb, deps) {
  var mountedRef = useMountedRef();
  useEffect(function () {
    if (!mountedRef.current) return;
    return cb();
  }, deps);
});