framus
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i framus

Weekly Downloads

2

Version

0.2.0

License

MIT

Unpacked Size

9.42 kB

Total Files

8

Last publish

Collaborators

  • m3g4p0p