react-spy-scroll
Version:
Scrollspy components for react
23 lines (19 loc) • 514 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
function native() {
if (window) {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame;
}
return undefined;
}
function polyfill() {
return function (callback, element, delay) {
setTimeout(callback, delay || 1000 / 60, new Date().getTime());
};
}
function createRequestAnimationFrame() {
return native() || polyfill();
}
exports.default = createRequestAnimationFrame();