refactor(Completer): rename complete() to resolve()

This commit is contained in:
Victor Berchet
2015-02-25 12:46:50 +01:00
parent 6ad2c18277
commit 41c61e5bc7
8 changed files with 14 additions and 14 deletions

View File

@ -125,7 +125,7 @@ export function bootstrap(appComponentType: Type, bindings: List<Binding>=null,
lc.registerWith(zone, rootView.changeDetector);
lc.tick(); //the first tick that will bootstrap the app
bootstrapProcess.complete(appInjector);
bootstrapProcess.resolve(appInjector);
},
(err) => {

View File

@ -11,7 +11,7 @@ export class XHRImpl extends XHR {
xhr.onload = function() {
var status = xhr.status;
if (200 <= status && status <= 300) {
completer.complete(xhr.responseText);
completer.resolve(xhr.responseText);
} else {
completer.reject(`Failed to load ${url}`);
}

View File

@ -33,7 +33,7 @@ class _Completer {
Future get promise => c.future;
void complete(v) {
void resolve(v) {
c.complete(v);
}

View File

@ -32,7 +32,7 @@ export class PromiseWrapper {
return {
promise: p,
complete: resolve,
resolve: resolve,
reject: reject
};
}

View File

@ -90,7 +90,7 @@ class _PendingRequest {
if (isBlank(response)) {
this.completer.reject(`Failed to load ${this.url}`);
} else {
this.completer.complete(response);
this.completer.resolve(response);
}
}