UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) • 383 B
import{useEffect as i}from"react";import{notifyCameraMoved as a}from"../Map/camera-events";export function useKioskCameraEvents(o,n){i(()=>{const e=n.current;if(!o||!e)return;let t=!1;const r=f=>{f.originalEvent&&(t=!0,window.__resett?.())},s=()=>{a(),t&&(t=!1,window.__resett?.())};return e.on("movestart",r),e.on("moveend",s),()=>{e.off("movestart",r),e.off("moveend",s)}},[o,n])}