Skip to content
This repository was archived by the owner on May 25, 2021. It is now read-only.

Latest commit

 

History

History
34 lines (23 loc) · 511 Bytes

File metadata and controls

34 lines (23 loc) · 511 Bytes

raf-queue

Batch jobs to fire in the next frame using requestAnimationFrame.

Installation

with component:

component install pilotcreative/raf-queue

with browserify and friends:

npm install raf-queue

Usage

var frame = require('raf-queue');

// Add jobs to the job, returns an id
var job = frame.add(increment);

// Remove jobs from the queue
frame.remove(job);

// Fires after the jobs from the next frame are done
frame.defer(function(){
  console.log('job done!');
});