Last change
on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
783 bytes
|
Line | |
---|
1 | import { AsyncScheduler } from './AsyncScheduler';
|
---|
2 | export class AsapScheduler extends AsyncScheduler {
|
---|
3 | flush(action) {
|
---|
4 | this.active = true;
|
---|
5 | this.scheduled = undefined;
|
---|
6 | const { actions } = this;
|
---|
7 | let error;
|
---|
8 | let index = -1;
|
---|
9 | let count = actions.length;
|
---|
10 | action = action || actions.shift();
|
---|
11 | do {
|
---|
12 | if (error = action.execute(action.state, action.delay)) {
|
---|
13 | break;
|
---|
14 | }
|
---|
15 | } while (++index < count && (action = actions.shift()));
|
---|
16 | this.active = false;
|
---|
17 | if (error) {
|
---|
18 | while (++index < count && (action = actions.shift())) {
|
---|
19 | action.unsubscribe();
|
---|
20 | }
|
---|
21 | throw error;
|
---|
22 | }
|
---|
23 | }
|
---|
24 | }
|
---|
25 | //# sourceMappingURL=AsapScheduler.js.map |
---|
Note:
See
TracBrowser
for help on using the repository browser.