JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1560
  • Score
    100M100P100Q120684F
  • License ISC

Abbott breaks promises. Turns them back into CPS style

Package Exports

  • abbott

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 (abbott) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Abbott

Abbott breaks promises. Turns them back into CPS style

Usage

var abbott = require('abbott');

// make a promise
var promise = something();

// break it
var normalAsyncFunction = abbott(somePromise);

// use it
normalAsyncFunction(function(error, data){
    // Welcome back to reality.
});

You can also pass a function that returns a promise, and it will give you a nice CPS version:

// instead of
somethingThatReturnsAPromise('foo', 'bar').then(successCallback, errorCallback);

// you can do
abbott(somethingThatReturnsAPromise)('foo', 'bar', callback);