1 import { AnimationFrameAction } from './AnimationFrameAction';
2 import { AnimationFrameScheduler } from './AnimationFrameScheduler';
6 * Animation Frame Scheduler
8 * <span class="informal">Perform task when `window.requestAnimationFrame` would fire</span>
10 * When `animationFrame` scheduler is used with delay, it will fall back to {@link asyncScheduler} scheduler
13 * Without delay, `animationFrame` scheduler can be used to create smooth browser animations.
14 * It makes sure scheduled task will happen just before next browser content repaint,
15 * thus performing animations as efficiently as possible.
18 * Schedule div height animation
20 * // html: <div style="background: #0ff;"></div>
21 * import { animationFrameScheduler } from 'rxjs';
23 * const div = document.querySelector('div');
25 * animationFrameScheduler.schedule(function(height) {
26 * div.style.height = height + "px";
28 * this.schedule(height + 1); // `this` references currently executing Action,
29 * // which we reschedule with new state
32 * // You will see a div element growing in height
35 export const animationFrameScheduler = new AnimationFrameScheduler(AnimationFrameAction);
38 * @deprecated renamed. Use {@link animationFrameScheduler}
40 export const animationFrame = animationFrameScheduler;