request-animation-frame-polyfill

v1.1.0-rc.2
requestAnimationFrame polyfill library
raf requestAnimationFrame

request-animation-frame-polyfill

npm version

requestAnimationFrame polyfill library for nodejs and old browsers.

Install

$ yarn add request-animation-frame-polyfill

Usage

import { requestAnimationFrame, cancelAnimationFrame } from 'request-animation-frame-polyfill'

let id: number
const hello = (time: number) => {
  console.log('hello:' + time)
  id = requestAnimationFrame(hello)
}

id = requestAnimationFrame(hello)
setTimeout( () => cancelAnimationFrame(id), 100)

Build

Build:

$ yarn build

Example

$ cd example
$ npx ts-node main.ts

Deploy

$ npm login
$ npm publish

Metadata

  • MIT
  • Whatever
  • aluc
  • released 2/6/2021

Downloads