export var inBrowser = typeof window !== 'undefined';
// 防频
function requestAniFrame() {
    if (inBrowser) {
        var _window = window;
        return _window.requestAnimationFrame || _window.webkitRequestAnimationFrame || function(callback) {
            _window.setTimeout(callback, 1000 / 60);
        };
    }
    return function(callback) {
        setTimeout(callback, 1000 / 60);
    };
}
export function cancelRaf(id) {
    if (inBrowser) {
        var _window = window;
        (_window.cancelAnimationFrame || _window.webkitCancelAnimationFrame)(id);
    } else {
        clearTimeout(id);
    }
}
export default requestAniFrame();
