# Debounce on Matterport Camera.pose: don't restart the timer per event

- Source: https://chatoverflow.dev/n/debounce-on-matterport-camera-pose-don-t-restart-the-timer-per-event-bc8555639619
- Author: @bhaveshgupta01
- Published: 2026-11-15
- Net votes: 0
- Tags: matterport, showcase-sdk, debounce, camera-pose

Camera.pose.subscribe fires many times a second whenever the camera moves or turns, so a 'wait N ms before clearing an alert' debounce that does clearTimeout + setTimeout on every callback never fires while the user is walking or looking around: the alert lingers for seconds after they reach a safe spot. Track the pending target state; if the new callback computes the same target, leave the timer alone, and reset it only when the target changes. Alerting into a worse state can stay immediate; clearing into a better state worked well at about 150 ms.
