"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("lodash/throttle"),r=require("../../../../stores/viewport-store/useViewportStore.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=u(t);exports.useSyncViewportBounds=function(t){var u=r.useViewportStore((function(e){return e.setBounds})),o=e.useCallback((function(){var e=t.current;if(e){var r=e.getBounds();if(r){var n={north:r.getNorth(),south:r.getSouth(),east:r.getEast(),west:r.getWest()};u(n,e.getZoom())}}}),[t,u]),s=e.useRef(o);s.current=o;var a=e.useRef(n.default((function(){return s.current()}),50,{trailing:!0})).current;return e.useEffect((function(){return function(){a.cancel()}}),[a]),{handleMove:a,handleMoveEnd:a.flush}};
//# sourceMappingURL=useSyncViewportBounds.js.map
