A+ like promise library
JavaScript CSS HTML
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.travis.yml
README.md
bower.json
index.js
package.json

README.md

Promises/A+ logo

pzero build status

API extentions for p0 A+ promises

How to use

Node

Install it with NPM or add it to your package.json:

npm install pzero

Then:

var pzero = require('pzero');

Browser

<script src="pzero.js"></script>

Api

var promise1 = pzero();
var promise2 = pzero();

pzero
    .when([promise1, promise2])
    .then( 
        function(values) {
            var value1 = values[0];
            var value2 = values[1];
        },
        function(reason) {}
    );

promise1
    .fail(function(reason) {});

promise1.callback(function(reason, value) {});

var cb = promise1.callback();
// reject promise -> cb(reason);
// fulfill promise -> cb(null, value);