Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stagas/fills
ordered callback results accumulator
https://github.com/stagas/fills
Last synced: 13 days ago
JSON representation
ordered callback results accumulator
- Host: GitHub
- URL: https://github.com/stagas/fills
- Owner: stagas
- Created: 2013-12-02T17:54:06.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2013-12-02T17:56:23.000Z (almost 11 years ago)
- Last Synced: 2024-04-08T15:44:49.183Z (7 months ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# fills
ordered callback results accumulator
## Installing
`npm install fills`
## Example
```js
var waits = require('waits');
var fills = require('fills');var i = 0;
var fn = waits(next);
var cup = [];
async(fn(fills(cup)));
async(fn(fills(cup)));
async(fn(fills(cup)));//
// output:
//
// x is 2
// x is 0
// x is 1
//function next(){
console.log(cup); // => [ 0, 1, 2 ]
}function async(fn){
setTimeout(function(x){
console.log('x is', x);
fn(null, x);
}, Math.random() * 1000, i++);
}
```## API
### fn = fills(cup)
Factories a callback filling results in `cup`.
## License
MIT