request-animation-frame-polyfill
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

request-animation-frame-polyfill

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 & Test

Build:

$ yarn install
$ npx babel src/index.ts > lib/request-animation-frame-polyfill.js

Test:

$ yarn test

Deploy

$ npm login
$ npm publish

Package Sidebar

Install

npm i request-animation-frame-polyfill@1.0.2

Version

1.0.2

License

MIT

Unpacked Size

8.99 kB

Total Files

8

Last publish

Collaborators

  • b6pzeusbc54tvhw5jgpyw8pwz2x6gs