Naively Programmable Module

    pzero

    0.4.7 • Public • Published

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

    Install

    npm i pzero

    DownloadsWeekly Downloads

    1

    Version

    0.4.7

    License

    none

    Last publish

    Collaborators

    • artjock