blob: cb658cb4c37347681cbb0ba6e2c72db9bb2a3ba1 [file] [log] [blame]
import { AsyncScheduler } from './AsyncScheduler';
export class AnimationFrameScheduler extends AsyncScheduler {
flush(action) {
this.active = true;
this.scheduled = undefined;
const { actions } = this;
let error;
let index = -1;
let count = actions.length;
action = action || actions.shift();
do {
if (error = action.execute(action.state, action.delay)) {
break;
}
} while (++index < count && (action = actions.shift()));
this.active = false;
if (error) {
while (++index < count && (action = actions.shift())) {
action.unsubscribe();
}
throw error;
}
}
}
//# sourceMappingURL=AnimationFrameScheduler.js.map