"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.countTypes = exports.countMethods = exports.useDebounce = void 0;

var _react = require("react");

var useDebounce = (value, delay) => {
  var [debouncedValue, setDebouncedValue] = (0, _react.useState)(value);
  (0, _react.useEffect)(() => {
    var handler = setTimeout(() => {
      setDebouncedValue(value);
    }, delay);
    return () => {
      clearTimeout(handler);
    };
  }, [value]);
  return debouncedValue;
};

exports.useDebounce = useDebounce;

var countMethods = tags => {
  var result = 0;
  Object.values(tags).forEach(methods => {
    result += Object.entries(methods).length;
  });
  return result;
};

exports.countMethods = countMethods;

var countTypes = types => Object.entries(types).length;

exports.countTypes = countTypes;
//# sourceMappingURL=searchUtils.js.map