import { AsyncAction } from './AsyncAction'; import { AsyncScheduler } from './AsyncScheduler'; export class AsapScheduler extends AsyncScheduler { public flush(action?: AsyncAction<any>): void { this.active = true; this.scheduled = undefined; const {actions} = this; let error: any; let index: number = -1; let count: number = 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; } } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
Action.ts | File | 1.28 KB | 0644 |
|
AnimationFrameAction.ts | File | 1.99 KB | 0644 |
|
AnimationFrameScheduler.ts | File | 756 B | 0644 |
|
AsapAction.ts | File | 1.96 KB | 0644 |
|
AsapScheduler.ts | File | 746 B | 0644 |
|
AsyncAction.ts | File | 4.8 KB | 0644 |
|
AsyncScheduler.ts | File | 1.93 KB | 0644 |
|
QueueAction.ts | File | 1.4 KB | 0644 |
|
QueueScheduler.ts | File | 107 B | 0644 |
|
VirtualTimeScheduler.ts | File | 2.99 KB | 0644 |
|
animationFrame.ts | File | 1.35 KB | 0644 |
|
asap.ts | File | 1.67 KB | 0644 |
|
async.ts | File | 1.5 KB | 0644 |
|
queue.ts | File | 2.03 KB | 0644 |
|