fix: async hook

This commit is contained in:
thinkinggis 2020-02-26 08:46:19 +08:00
parent 0ee59fe01f
commit 97f3d9d18d
1 changed files with 1 additions and 12 deletions

View File

@ -9,18 +9,7 @@ export default class AsyncParallelHook {
}
public promise(...args: any[]) {
return new Promise((resolve, reject) => {
async.parallel(this.tasks).then((res: any, err: any) => {
if (err) {
reject(err);
}
resolve();
});
});
// return async.parallel(this.tasks).then((err, res) => {
// return new Promise(r);
// });
return async.parallel(this.tasks);
}
public tapPromise(name: string, cb: CallBack) {
this.tasks.push(async (callback: any) => {