Promise wrapper for requesting an animation frame.
yarn add framus
function framus(callback?: function, options?: object): Promise
import { framus } from 'framus'
framus(now => {
document.body.textContent = now
})
;(async () => {
document.body.textContent = await framus()
})()
const controller = new AbortController()
framus({ signal: controller.signal }).catch(console.error)
controller.abort()
MIT 2019