pub fn request_animation_frame<F>(callback_once: F) -> AnimationFramewhere
    F: FnOnce(f64) + 'static,
Expand description

Calls browser’s requestAnimationFrame. It is cancelled when the handler is dropped.

MDN Documentation