0.2.0 • Published 5 years ago

framus v0.2.0

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

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