import{useCallback as t,useRef as r,useEffect as e}from"react";import o from"lodash/throttle";import{useViewportStore as n}from"../../../../stores/viewport-store/useViewportStore.js";var u=function(u){var i=n((function(t){return t.setBounds})),s=t((function(){var t=u.current;if(t){var r=t.getBounds();if(r){var e={north:r.getNorth(),south:r.getSouth(),east:r.getEast(),west:r.getWest()};i(e,t.getZoom())}}}),[u,i]),a=r(s);a.current=s;var c=r(o((function(){return a.current()}),50,{trailing:!0})).current;return e((function(){return function(){c.cancel()}}),[c]),{handleMove:c,handleMoveEnd:c.flush}};export{u as useSyncViewportBounds};
//# sourceMappingURL=useSyncViewportBounds.js.map
