securityos/node_modules/regl/lib/util/raf.js

10 lines
369 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
/* 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
}