2025-03-24 22:56:10 +01:00

14 lines
365 B
JavaScript

export const syncDriver = (interval = 10) => (update) => {
let isRunning = true;
return {
start: () => {
setTimeout(() => {
update(0);
while (isRunning)
update(interval);
}, 0);
},
stop: () => (isRunning = false),
};
};
//# sourceMappingURL=utils.js.map