"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = useInterval;
var _react = require("react");
function useInterval(callback, delay) {
  (0, _react.useEffect)(function () {
    if (delay !== null) {
      var id = setInterval(callback, delay);
      return function () {
        return clearInterval(id);
      };
    }
    return undefined;
  }, [callback, delay]);
}
//# sourceMappingURL=useInterval.js.map
