Skip to content
This repository was archived by the owner on May 10, 2020. It is now read-only.

ab-5v/p0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Promises/A+ logo p0 build status

Minimal and fast Promise/A+ 1.1 implementation. It's all you need to pass the tests and build your own extended API.

Installation

Node.js

npm install p0

Browser

<script src="p0/index.min.js"></script>

Usage

var p0 = require('./');

var promise1 = new p0();

var promise2 = promise1.then(
    null,
    function(reason) {
        var promise3 = new p0();
        setTimeout(function() {
            promise3.fulfill(reason + 'bar');
        }, 100);
        return promise3;
    }
);

promise1.reject('foo');

promise2.then(function(value) { console.log(value); });
// will output "foobar" after 100ms

Fill free to use specs as more descriptive documentation.

License

MIT

About

Minimal Promise/A+ 1.1 implementation.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors