abbott

Abbott breaks promises. Turns them back into CPS style

  • abbott

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
abbott
2601.1.37 years ago8 years agoMinified + gzip package size for abbott in KB

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);