mirror of https://gitee.com/antv-l7/antv-l7
fix: async hook
This commit is contained in:
parent
0ee59fe01f
commit
97f3d9d18d
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue