throttledAnimLog
FitFileViewer - API Documentation v29.4.0
FitFileViewer - API Documentation / utils/debug/lastAnimLog / throttledAnimLog
Variable: throttledAnimLog()
constthrottledAnimLog: (message:any) =>void
Defined in: utils/debug/lastAnimLog.js:38
Internal
Logs animation progress messages to the console at most once every 500ms to prevent log flooding. Intended for development/debug logging onlyβautomatically disabled in production builds.
This utility uses a closure to maintain state and throttle log messages, which is particularly useful for high-frequency events like animation frames or scroll handlers.
Parametersβ
messageβ
any
The message to log to the console
Returnsβ
void
Examplesβ
// Log animation frame updates (throttled to max once per 500ms)
throttledAnimLog('Animation frame updated: frame 1234');
throttledAnimLog('Chart rendering progress: 45%');
// Use in animation loops
function animateChart() {
throttledAnimLog(`Chart animation progress: ${progress}%`);
// ... animation logic
requestAnimationFrame(animateChart);
}
@internal
Sinceβ
1.0.0