"use strict";

exports.__esModule = true;
exports["default"] = void 0;

var _react = require("react");

// 获取上一次的值, 用于比较上一次的值
// 使用方法:

/*
const prevValue = usePrevious(value)
*/
function usePrevious(value) {
  var ref = (0, _react.useRef)();
  (0, _react.useEffect)(function () {
    ref.current = value;
  });
  return ref.current;
}

var _default = usePrevious;
exports["default"] = _default;
module.exports = exports.default;