Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 762 Bytes

README.md

File metadata and controls

36 lines (26 loc) · 762 Bytes

animationFrame

A requestAnimationFrame and cancelAnimationFrame compatible javascript library which provide base support for the animation.

Usage

ES6 and beyond

  import animationFrame from '@pandolajs/animationframe'

  const { raf, caf, highResTimestamp } = animationFrame

  // raf: requestAnimationFrame
  // caf: cancelAnimationFrame
  // highResTimestamp

UMD

  <script src="https://path.to.animationframe" />
  <script>
    window.animationFrame.raf()
    window.animationFrame.caf()
    window.animationFrame.highResTimestamp()
  </script>

APIs

{ raf: Function | window.requestAnimationFrame caf: Function | window.cancelAnimationFrame highResTimestamp: Function | window.performance.now() }