rsvp-backlog

0.2.0 • Public • Published

rsvp-backlog

Build status

var backlog = RSVP.createBacklog();
 
backlog.add(somePromise);
 
// Access a promise in the backlog directly
 
backlog.toArray()[0].then(doSomething);
 
// The promise behind .whenClear() resets when the backlog size goes from zero 
// to one, so you need at least one promise before you can call it
 
backlog.whenClear().then(doSomethingElse);
 
// Callback functions can be passed to handle additions, removals and 
// resolutions
 
backlog.whenChanged(function () {
 
    // The callback is bound to the backlog
 
    renderBacklogProgress(this.toArray().length);
 
});
 
// Resolving or removing the last promise in the backlog resolves the backlog
// as a whole
 
backlog.remove(somePromise);

Bower installation

From a terminal:

bower install rsvp-backlog

In your HTML:

<script src="bower_components/rsvp-backlog/rsvp-backlog.min.js">

Node installation

From a terminal:

npm install rsvp-backlog

In your script:

var createBacklog = require('rsvp-backlog'),
    backlog = createBacklog();

Package Sidebar

Install

npm i rsvp-backlog

Weekly Downloads

1

Version

0.2.0

License

MIT

Last publish

Collaborators

  • adamshaylor