Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/anthonyshort/raf-queue
- Owner: anthonyshort
- Created: 2014-04-16T06:43:28.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-08-13T18:05:43.000Z (about 5 years ago)
- Last Synced: 2024-04-15T03:16:20.534Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 191 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
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!');
});
```