request-animation-frame-polyfill
v1.1.2
Published
requestAnimationFrame polyfill library
Downloads
8,024
Maintainers
Readme
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
Build:
$ yarn build
Example
$ cd example
$ npx ts-node main.ts
Deploy
$ npm login
$ npm publish