Skip to content

Commit 8dba865

Browse files
committed
add note to future
1 parent 2fcbffe commit 8dba865

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/core/clockworker.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// eslint-disable-next-line no-undef
22
importScripts('./neozyklus.js');
3+
// TODO: swap below line with above one when firefox supports esm imports in service workers
4+
// see https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker?retiredLocale=de#browser_compatibility
5+
// import createClock from './zyklus.mjs';
36

47
function getTime() {
58
const precision = 10 ** 4;

packages/core/zyklus.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function createClock(
2323
// callback as long as we're inside the lookahead
2424
while (phase < lookahead) {
2525
phase = Math.round(phase * precision) / precision;
26-
phase >= t && callback(phase, duration, tick);
26+
phase >= t && callback(phase, duration, tick, t);
2727
phase < t && console.log('TOO LATE', phase); // what if latency is added from outside?
2828
phase += duration; // increment phase by duration
2929
tick++;

0 commit comments

Comments
 (0)