"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useTraceUpdate = useTraceUpdate;
var _react = require("react");
function useTraceUpdate(props) {
  var prev = (0, _react.useRef)(props);
  (0, _react.useEffect)(() => {
    var changedProps = Object.entries(props).reduce((ps, _ref) => {
      var [k, v] = _ref;
      if (prev.current[k] !== v) {
        ps[k] = [prev.current[k], v];
      }
      return ps;
    }, {});
    if (Object.keys(changedProps).length > 0) {
      console.log('Changed props:', changedProps);
    }
    prev.current = props;
  });
}