rsvp-backlog

Like RSVP.all() but a little smarter

Usage no npm install needed!

<script type="module">
  import rsvpBacklog from 'https://cdn.skypack.dev/rsvp-backlog';
</script>

README

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();