import * as u from "react";
function c() {
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 250, n = u.useRef(null), e = u.useRef(null);
  u.useEffect(function() {
    return function() {
      window.clearTimeout(e.current);
    };
  }, []);
  function o(r) {
    (r || n.current === null) && (n.current = r), window.clearTimeout(e.current), e.current = window.setTimeout(function() {
      n.current = null;
    }, t);
  }
  return [function() {
    return n.current;
  }, o];
}
export {
  c as default
};
