framus
v0.2.0
Published
Promise wrapper for requesting an animation frame.
Downloads
3
Readme
framus
Promise wrapper for requesting an animation frame.
Installation
yarn add framus
Usage
function framus(callback?: function, options?: object): Promise
Callback based
import { framus } from 'framus'
framus(now => {
document.body.textContent = now
})
Promise based
;(async () => {
document.body.textContent = await framus()
})()
With abort signal option
const controller = new AbortController()
framus({ signal: controller.signal }).catch(console.error)
controller.abort()
License
MIT 2019