Fixed circular reference #2
This commit is contained in:
@@ -23,8 +23,12 @@ class FetchOnce {
|
||||
this.state = ResolvableState.WAITING;
|
||||
this.pendings = [];
|
||||
}
|
||||
reset() {
|
||||
this.data = undefined;
|
||||
this.error = undefined;
|
||||
this.state = ResolvableState.WAITING;
|
||||
}
|
||||
resolve(...args) {
|
||||
// eslint-disable-next-line promise/avoid-new
|
||||
return new Promise((resolve, reject) => {
|
||||
switch (this.state) {
|
||||
case ResolvableState.WAITING:
|
||||
@@ -81,5 +85,9 @@ class WaitForSync extends FetchOnce {
|
||||
this.parsePromise((() => __awaiter(this, void 0, void 0, function* () { throw error; }))());
|
||||
}
|
||||
}
|
||||
reset() {
|
||||
super.reset();
|
||||
this.state = ResolvableState.PENDING;
|
||||
}
|
||||
}
|
||||
exports.WaitForSync = WaitForSync;
|
||||
|
||||
Reference in New Issue
Block a user