JSPM

  • Created
  • Published
  • Downloads 1016
  • Score
    100M100P100Q114423F
  • License MIT

requestAnimationFrame polyfill library

Package Exports

  • request-animation-frame-polyfill

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (request-animation-frame-polyfill) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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

Deploy

$ npm login
$ npm publish