Files
openlayers/test/browser/spec/util.js
2021-04-28 09:23:33 -07:00

17 lines
410 B
JavaScript

export function overrideRAF() {
const raf = window.requestAnimationFrame;
const caf = window.cancelAnimationFrame;
window.requestAnimationFrame = function (callback) {
return setTimeout(callback, 1);
};
window.cancelAnimationFrame = function (key) {
return clearTimeout(key);
};
return function () {
window.requestAnimationFrame = raf;
window.cancelAnimationFrame = caf;
};
}