Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/anthonyshort/raf-queue

Batch jobs to fire in the next frame using requestAnimationFrame.
https://github.com/anthonyshort/raf-queue

Last synced: 24 days ago
JSON representation

Batch jobs to fire in the next frame using requestAnimationFrame.

Awesome Lists containing this project

README

        

# raf-queue

Batch jobs to fire in the next frame using requestAnimationFrame.

## Installation

with component:

```
component install anthonyshort/raf-queue
```

with browserify and friends:

```
npm install raf-queue
```

## Usage

```js
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!');
});
```