Last change
on this file since 6a80231 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[6a3a178] | 1 | import { AnimationFrameScheduler } from './AnimationFrameScheduler';
|
---|
| 2 | /**
|
---|
| 3 | *
|
---|
| 4 | * Animation Frame Scheduler
|
---|
| 5 | *
|
---|
| 6 | * <span class="informal">Perform task when `window.requestAnimationFrame` would fire</span>
|
---|
| 7 | *
|
---|
| 8 | * When `animationFrame` scheduler is used with delay, it will fall back to {@link asyncScheduler} scheduler
|
---|
| 9 | * behaviour.
|
---|
| 10 | *
|
---|
| 11 | * Without delay, `animationFrame` scheduler can be used to create smooth browser animations.
|
---|
| 12 | * It makes sure scheduled task will happen just before next browser content repaint,
|
---|
| 13 | * thus performing animations as efficiently as possible.
|
---|
| 14 | *
|
---|
| 15 | * ## Example
|
---|
| 16 | * Schedule div height animation
|
---|
| 17 | * ```ts
|
---|
| 18 | * // html: <div style="background: #0ff;"></div>
|
---|
| 19 | * import { animationFrameScheduler } from 'rxjs';
|
---|
| 20 | *
|
---|
| 21 | * const div = document.querySelector('div');
|
---|
| 22 | *
|
---|
| 23 | * animationFrameScheduler.schedule(function(height) {
|
---|
| 24 | * div.style.height = height + "px";
|
---|
| 25 | *
|
---|
| 26 | * this.schedule(height + 1); // `this` references currently executing Action,
|
---|
| 27 | * // which we reschedule with new state
|
---|
| 28 | * }, 0, 0);
|
---|
| 29 | *
|
---|
| 30 | * // You will see a div element growing in height
|
---|
| 31 | * ```
|
---|
| 32 | */
|
---|
| 33 | export declare const animationFrameScheduler: AnimationFrameScheduler;
|
---|
| 34 | /**
|
---|
| 35 | * @deprecated renamed. Use {@link animationFrameScheduler}
|
---|
| 36 | */
|
---|
| 37 | export declare const animationFrame: AnimationFrameScheduler;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.