async-manager-promise
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -7,4 +7,11 @@ import AsyncManager from 'async-manager'; | ||
getPromise(id) { | ||
const promise = new Promise(async (resolve) => { | ||
this.manager.add(id, resolve); | ||
const promise = new Promise(async (resolve, reject) => { | ||
this.manager.add(id, (err, data) => { | ||
if (err) { | ||
reject(err); | ||
} | ||
else { | ||
resolve(data); | ||
} | ||
}); | ||
}); | ||
@@ -11,0 +18,0 @@ return promise; |
{ | ||
"name": "async-manager-promise", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "TODO", | ||
@@ -5,0 +5,0 @@ "main": "./build/index.js", |
@@ -7,4 +7,10 @@ import AsyncManager from 'async-manager' | ||
getPromise(id: Id) { | ||
const promise = new Promise<OutputType>(async (resolve) => { | ||
this.manager.add(id, resolve) | ||
const promise = new Promise<OutputType>(async (resolve, reject) => { | ||
this.manager.add(id, (err, data) => { | ||
if (err) { | ||
reject(err) | ||
} else { | ||
resolve(data) | ||
} | ||
}) | ||
}) | ||
@@ -11,0 +17,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5421
105