var LoopControl = /** @class */ (function () {
    function LoopControl() {
        var _this = this;
        this._requestAnimationFrame = window.requestAnimationFrame.bind(window);
        this._createVoidLoop = function (callback) {
            return function () {
                _this.requestAnimationFrame(callback);
            };
        };
        this._requestQueue = [];
        this.requestAnimationFrame = function (callback) {
            var _a = _this, raf = _a._requestAnimationFrame, queue = _a._requestQueue, vol = _a._createVoidLoop;
            if (_this.isLoop) {
                return raf(callback);
            }
            else {
                return raf(vol(callback));
            }
        };
        this.isLoop = true;
        // debugger;
        window.requestAnimationFrame = this.requestAnimationFrame;
    }
    return LoopControl;
}());
export default LoopControl;
