fixed SinglePromise reset order
This commit is contained in:
@@ -42,19 +42,23 @@ class SingleTimeoutPromise<T> {
|
||||
return this.interalPromise;
|
||||
}
|
||||
|
||||
public function isRunning():Bool {
|
||||
return this.inProgress;
|
||||
}
|
||||
|
||||
public function resolve(val:T) {
|
||||
if (this.inProgress) {
|
||||
this.interalResolve(val);
|
||||
this.inProgress = false;
|
||||
this.timer.cancle();
|
||||
this.interalResolve(val);
|
||||
}
|
||||
}
|
||||
|
||||
public function reject(err:Error) {
|
||||
if (this.inProgress) {
|
||||
this.interalReject(err);
|
||||
this.inProgress = false;
|
||||
this.timer.cancle();
|
||||
this.interalReject(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user