minor adjustment to readme
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / src / internal / scheduler / AnimationFrameScheduler.ts
1 import { AsyncAction } from './AsyncAction';
2 import { AsyncScheduler } from './AsyncScheduler';
3
4 export class AnimationFrameScheduler extends AsyncScheduler {
5   public flush(action?: AsyncAction<any>): void {
6
7     this.active = true;
8     this.scheduled = undefined;
9
10     const {actions} = this;
11     let error: any;
12     let index: number = -1;
13     let count: number = actions.length;
14     action = action || actions.shift();
15
16     do {
17       if (error = action.execute(action.state, action.delay)) {
18         break;
19       }
20     } while (++index < count && (action = actions.shift()));
21
22     this.active = false;
23
24     if (error) {
25       while (++index < count && (action = actions.shift())) {
26         action.unsubscribe();
27       }
28       throw error;
29     }
30   }
31 }