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

1.1.2 • Public • Published

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

Package Sidebar

Install

npm i request-animation-frame-polyfill

Weekly Downloads

3,308

Version

1.1.2

License

MIT

Unpacked Size

17.1 kB

Total Files

11

Last publish

Collaborators

  • b6pzeusbc54tvhw5jgpyw8pwz2x6gs