"use strict";

exports.__esModule = true;
exports["default"] = void 0;
var _react = require("react");
var _default = exports["default"] = function _default(value, distinct) {
  if (distinct === void 0) {
    distinct = false;
  }
  var prevRef = (0, _react.useRef)();
  (0, _react.useEffect)(function () {
    prevRef.current = value;
  }, [distinct ? value : ""]);
  return prevRef.current;
};