Skip to content

requestAnimationFrame

Provides a cross-browser compatible requestAnimationFrame function, with a fallback to setTimeout.

Usage

ts
import { requestAnimationFrame } from 'rattail'

requestAnimationFrame(() => {
  console.log('Frame requested')
})

Arguments

ArgTypeDefaults
fnFrameRequestCallback

Return

Type
number