fix(Dart1.8): Promise handling

This commit is contained in:
Victor Berchet
2014-12-01 20:06:21 +01:00
parent 0703ee526c
commit fc2181ec4e
2 changed files with 6 additions and 4 deletions

View File

@ -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);
}
}