Git Product home page Git Product logo

p0's Introduction

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

p0's People

Contributors

ab-5v avatar

Stargazers

Anne Thorpe avatar Vlad Dumitrica avatar Constantine Chuprik avatar Max Poletaev avatar Chris J. Lee avatar John S. Dvorak avatar Fredrik Forsmo avatar Daniel Waardal avatar Matteo Collina avatar  avatar Eugene Ware avatar Varya Stepanova avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.