10 lines
369 B
JavaScript
10 lines
369 B
JavaScript
/* globals requestAnimationFrame, cancelAnimationFrame */
|
|
module.exports = {
|
|
next: typeof requestAnimationFrame === 'function'
|
|
? function (cb) { return requestAnimationFrame(cb) }
|
|
: function (cb) { return setTimeout(cb, 16) },
|
|
cancel: typeof cancelAnimationFrame === 'function'
|
|
? function (raf) { return cancelAnimationFrame(raf) }
|
|
: clearTimeout
|
|
}
|