"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
var _react = _interopRequireDefault(require("react"));
var _resizeObserverPolyfill = _interopRequireDefault(require("resize-observer-polyfill"));
var useResizeObserver = function useResizeObserver(callbck, _ref) {
  var _ref2 = (0, _slicedToArray2.default)(_ref, 1),
    element = _ref2[0];
  _react.default.useEffect(function () {
    var resizeObserver = new _resizeObserverPolyfill.default(function () {
      callbck();
    });
    resizeObserver.observe(element);
    return function () {
      resizeObserver.disconnect();
    };
  }, []);
};
var _default = exports.default = useResizeObserver;