promise-callbacks
Advanced tools
Comparing version 3.6.0 to 3.7.0
@@ -0,1 +1,8 @@ | ||
## [3.7.0](https://github.com/mixmaxhq/promise-callbacks/compare/v3.6.0...v3.7.0) (2020-04-03) | ||
### Features | ||
* use callbackBuilder directly from callAsync ([2b3068f](https://github.com/mixmaxhq/promise-callbacks/commit/2b3068f06ea96a0eaa8f536b094f3d5e6ca48e04)) | ||
## [3.6.0](https://github.com/mixmaxhq/promise-callbacks/compare/v3.5.0...v3.6.0) (2020-02-28) | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "promise-callbacks", | ||
"version": "3.6.0", | ||
"version": "3.7.0", | ||
"description": "Utilities to help convert a callback-using codebase to promises.", | ||
@@ -40,3 +40,3 @@ "engines": { | ||
"eslint": "^6.8.0", | ||
"eslint-config-mixmax": "^4.8.0", | ||
"eslint-config-mixmax": "^4.9.0", | ||
"express": "^4.15.2", | ||
@@ -43,0 +43,0 @@ "jasmine-promises": "github:mixmaxhq/jasmine-promises#working_in_node", |
'use strict'; | ||
const deferred = require('./deferred'); | ||
const callbackBuilder = require('./callbackBuilder'); | ||
@@ -13,7 +13,5 @@ /** | ||
async function callAsync(fn) { | ||
const promise = deferred(); | ||
fn(promise.defer()); | ||
return promise; | ||
return new Promise((resolve, reject) => fn(callbackBuilder(resolve, reject))); | ||
} | ||
module.exports = callAsync; |
47266
981