@xtia/jel 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/internal/emitter.js +2 -3
- package/package.json +1 -1
package/internal/emitter.js
CHANGED
|
@@ -456,10 +456,9 @@ export const animationFrames = (() => {
|
|
|
456
456
|
let rafId = null;
|
|
457
457
|
let lastTime = null;
|
|
458
458
|
const frame = (time) => {
|
|
459
|
-
if (lastTime === null)
|
|
460
|
-
lastTime = time;
|
|
461
459
|
rafId = requestAnimationFrame(frame);
|
|
462
|
-
const elapsed = time - lastTime;
|
|
460
|
+
const elapsed = time - (lastTime !== null && lastTime !== void 0 ? lastTime : time);
|
|
461
|
+
lastTime = time;
|
|
463
462
|
emit(elapsed);
|
|
464
463
|
};
|
|
465
464
|
rafId = requestAnimationFrame(frame);
|