@essentials/raf
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -5,6 +5,6 @@ 'use strict' | ||
exports.caf = exports.raf = void 0 | ||
let p = typeof performance !== 'undefined' ? performance : Date | ||
let raf, | ||
caf, | ||
win = typeof window !== 'undefined' ? window : void 0 | ||
win = typeof window !== 'undefined' ? window : void 0, | ||
p = typeof performance !== 'undefined' ? performance : Date | ||
exports.caf = caf | ||
@@ -29,4 +29,4 @@ exports.raf = raf | ||
exports.raf = raf = (callback) => { | ||
let curr = p.now() | ||
let next = Math.max(lastTime + 1000 / 60, curr) | ||
let curr = p.now(), | ||
next = Math.max(lastTime + 1000 / 60, curr) | ||
return setTimeout(() => { | ||
@@ -33,0 +33,0 @@ callback((lastTime = next)) |
@@ -1,5 +0,5 @@ | ||
let p = typeof performance !== 'undefined' ? performance : Date | ||
let raf, | ||
caf, | ||
win = typeof window !== 'undefined' ? window : void 0 | ||
win = typeof window !== 'undefined' ? window : void 0, | ||
p = typeof performance !== 'undefined' ? performance : Date | ||
@@ -22,4 +22,4 @@ if (win) { | ||
raf = (callback) => { | ||
let curr = p.now() | ||
let next = Math.max(lastTime + 1000 / 60, curr) | ||
let curr = p.now(), | ||
next = Math.max(lastTime + 1000 / 60, curr) | ||
return setTimeout(() => { | ||
@@ -26,0 +26,0 @@ callback((lastTime = next)) |
{ | ||
"name": "@essentials/raf", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"homepage": "https://github.com/jaredLunde/essentials/tree/master/packages/raf#readme", | ||
@@ -5,0 +5,0 @@ "repository": "github:jaredLunde/essentials", |
6070