function rafImplementation(global) {
    let lastTime = 0;
    const _requestAnimationFrame = function requestAnimationFrame(callback) {
        const currTime = new Date().getTime();
        const timeToCall = Math.max(0, 16 - (currTime - lastTime));
        const id = global.setTimeout(function () {
            callback(currTime + timeToCall);
        }, timeToCall);
        lastTime = currTime + timeToCall;
        return id;
    };
    const _cancelAnimationFrame = function cancelAnimationFrame(id) {
        clearTimeout(id);
    };
    return {
        requestAnimationFrame: _requestAnimationFrame,
        cancelAnimationFrame: _cancelAnimationFrame
    };
}
/**
 * Returns an object containing the properties that are relevant to 'requestAnimationFrame' and 'requestIdleCallback'
 */
Returns an object containing the properties that are relevant to 'requestAnimationFrame' and 'requestIdleCallback'
Returns an object containing the properties that are relevant to ' requestAnimationFrame ' and ' requestIdleCallback '
function rafImplementation(global) {
    let lastTime = 0;
    const _requestAnimationFrame = function requestAnimationFrame(callback) {
        const currTime = new Date().getTime();
        const timeToCall = Math.max(0, 16 - (currTime - lastTime));
        const id = global.setTimeout(function () {
            callback(currTime + timeToCall);
        }, timeToCall);
        lastTime = currTime + timeToCall;
        return id;
    };
    const _cancelAnimationFrame = function cancelAnimationFrame(id) {
        clearTimeout(id);
    };
    return {
        requestAnimationFrame: _requestAnimationFrame,
        cancelAnimationFrame: _cancelAnimationFrame
    };
}
function rafImplementation ( global ) { let lastTime = 0 ; const _requestAnimationFrame = function requestAnimationFrame ( callback ) { const currTime = new Date ( ) . getTime ( ) ; const timeToCall = Math . max ( 0 , 16 - ( currTime - lastTime ) ) ; const id = global . setTimeout ( function ( ) { callback ( currTime + timeToCall ) ; } , timeToCall ) ; lastTime = currTime + timeToCall ; return id ; } ; const _cancelAnimationFrame = function cancelAnimationFrame ( id ) { clearTimeout ( id ) ; } ; return { requestAnimationFrame : _requestAnimationFrame , cancelAnimationFrame : _cancelAnimationFrame } ; }
Returns an object containing the properties that are relevant to 'requestAnimationFrame' and 'requestIdleCallback'
Returns an object containing the properties that are relevant to ' requestAnimationFrame ' and ' requestIdleCallback '