fix(Dart1.8): Promise handling
This commit is contained in:
@ -12,11 +12,12 @@ class PromiseWrapper {
|
||||
return new Future.error(obj);
|
||||
}
|
||||
|
||||
static Future all(List<Future> promises){
|
||||
static Future<List> all(List<Future> promises){
|
||||
return Future.wait(promises);
|
||||
}
|
||||
|
||||
static Future then(Future promise, Function success, Function onError){
|
||||
if (success == null) return promise.catchError(onError);
|
||||
return promise.then(success, onError: onError);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user