@f/raf

Request animation frame (polyfilled if it doesn't exist)

Stats

StarsIssuesVersionUpdatedCreatedSize
@f/raf
401.0.35 years ago6 years agoMinified + gzip package size for @f/raf in KB

Readme

raf

Build status Git tag NPM version Code style

Request animation frame (polyfilled if it doesn't exist)

Installation

$ npm install @f/raf

Usage

var raf = require('@f/raf')

raf(function () {
  element.scrollIntoView()
})

API

raf(fn)

  • fn - The function to be executed on the next animation frame

Returns: An integer id. Pass this to raf.cancel(id) if you want to cancel the frame before it happens.

License

MIT

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.