Skip to main content

throttledAnimLog

FitFileViewer - API Documentation v29.4.0


FitFileViewer - API Documentation / utils/debug/lastAnimLog / throttledAnimLog

Variable: throttledAnimLog()

const throttledAnimLog: (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