wishthis/node_modules/rxjs/dist/esm5/internal/scheduler/AnimationFrameScheduler.js

31 lines
1.1 KiB
JavaScript
Raw Normal View History

2022-06-08 10:36:39 +00:00
import { __extends } from "tslib";
import { AsyncScheduler } from './AsyncScheduler';
var AnimationFrameScheduler = (function (_super) {
__extends(AnimationFrameScheduler, _super);
function AnimationFrameScheduler() {
return _super !== null && _super.apply(this, arguments) || this;
}
AnimationFrameScheduler.prototype.flush = function (action) {
this._active = true;
var flushId = this._scheduled;
this._scheduled = undefined;
var actions = this.actions;
var error;
action = action || actions.shift();
do {
if ((error = action.execute(action.state, action.delay))) {
break;
}
} while ((action = actions[0]) && action.id === flushId && actions.shift());
this._active = false;
if (error) {
while ((action = actions[0]) && action.id === flushId && actions.shift()) {
action.unsubscribe();
}
throw error;
}
};
return AnimationFrameScheduler;
}(AsyncScheduler));
export { AnimationFrameScheduler };
//# sourceMappingURL=AnimationFrameScheduler.js.map