# animationFrame

|           |
| --------- |
| <h4></h4> |

## animationFrame

### Planificador Animation Frame

#### Firma

`const animationFrame: any;`

### Descripción

Lleva a cabo una acción en el momento en el que se dispararía `window.requestAnimationFrame`.

Cuando el planificador animationFrame se utiliza con delay, se comporta como el planificador [async](/api/schedulers/animationframe.md).

Sin delay, el planificador animationFrame se puede utilizar para crear animaciones del navegador fluidas. Se asegura de que la tarea planificada ocurra justo antes del siguiente repintado del navegador, llevando así a cabo las animaciones de la forma más eficiente posible.

### Ejemplo

Planificar animación de la altura de un div

```javascript
// html: <div style="background: #0ff;"></div>
import { animationFrameScheduler } from "rxjs";

const div = document.querySelector("div");

animationFrameScheduler.schedule(
  function (height) {
    div.style.height = height + "px";

    this.schedule(height + 1); // `this` referencia a la acción que se está ejecutando,
    // que se replanifica con un nuevo estado
  },
  0,
  0
);

// Se podrá observar un incremento en la altura de un elemento div
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.rxjs.es/api/schedulers/animationframe.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
