JSPM

  • Created
  • Published
  • Downloads 1232
  • Score
    100M100P100Q111957F
  • 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

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