MCPcopy Create free account
hub / github.com/Tong89/smartNode / startPolling

Function startPolling

frontend/src/stores/simulation.ts:270–281  ·  view source on GitHub ↗

* Start background polling. Safe to call multiple times — creates at most * one timer. Performs an immediate refresh before starting the interval.

(interval?: number)

Source from the content-addressed store, hash-verified

268 * one timer. Performs an immediate refresh before starting the interval.
269 */
270 function startPolling(interval?: number): void {
271 if (pollingTimer !== null) return; // already polling
272 if (interval !== undefined) {
273 pollInterval.value = interval;
274 }
275 void refreshAll();
276 pollingTimer = window.setInterval(() => {
277 void refreshAll();
278 // Sync the playback cursor to live time when not scrubbing.
279 tickPlaybackSync();
280 }, pollInterval.value);
281 }
282
283 /** Stop background polling and clear the timer. */
284 function stopPolling(): void {

Callers

nothing calls this directly

Calls 2

tickPlaybackSyncFunction · 0.85
refreshAllFunction · 0.70

Tested by

no test coverage detected