JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15
  • Score
    100M100P100Q45503F
  • License MIT

Wrapper for bluebird with extend feature.

Package Exports

  • bauer-promise

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bauer-promise) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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