1.1.3 • Published 10 years ago

bauer-promise v1.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

node-bauer-promise

Wrapper for bluebird with extend feature.

Installation

npm install bauer-promise

Usage

Use bauer-promise to create an extensible Promise constructor that is bound to a context object.

var myObject = {
  name: "Yuri",
  age: 30
};

var Promise = require("bauer-promise")(myObject);

Promise.extend({
  
  setAge: function() {
    return this.then(function(newAge) {
      this.age = newAge; // this === myObject
    });
  }
  
});

Promise.resolve(40).setAge();

API Summary

  • Promise

    • .extend(modules Array) :void
    • .extend(module String) :void
    • .extend(methods Object) :void
    • .extend(name String, method Object) :void
    • .extend(name String, method Function) :void

License

MIT

1.1.3

10 years ago

1.1.2

10 years ago

1.1.0

10 years ago

1.0.4

11 years ago

1.0.3

11 years ago

1.0.2

11 years ago

1.0.1

11 years ago

1.0.0

11 years ago