strudel/packages/core/time.mjs
Felix Roos 6e02bf59e9 Revert "refactor: remove old draw logic"
This reverts commit 95719654f3bfc5d3cc98c33816b402e2c0e38bd7.
2023-05-10 11:44:55 +02:00

12 lines
199 B
JavaScript

let time;
export function getTime() {
if (!time) {
throw new Error('no time set! use setTime to define a time source');
}
return time();
}
export function setTime(func) {
time = func;
}