mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
25 lines
783 B
JavaScript
25 lines
783 B
JavaScript
|
import { AsyncScheduler } from './AsyncScheduler';
|
||
|
export class AsapScheduler 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=AsapScheduler.js.map
|