diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2019-07-10 17:40:02 -0400 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-07-10 17:40:02 -0400 |
commit | 6ca470c067c7620cd9da7d8b8c1d553ee46f5d1c (patch) | |
tree | 2a2d492e0c07b3a29cc36eb5b144787647410d5a /src/new_fields/Proxy.ts | |
parent | 892608273cdfeba4cfb55c5c604bee4361b3be0e (diff) | |
parent | 2cd8ac79b4731ca98aafe8a92fa6fb132fe9e86f (diff) |
merged with master and prototype initialization refactor, still in progress and deathly buggy
Diffstat (limited to 'src/new_fields/Proxy.ts')
-rw-r--r-- | src/new_fields/Proxy.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/new_fields/Proxy.ts b/src/new_fields/Proxy.ts index 230e4ab8b..38d874a68 100644 --- a/src/new_fields/Proxy.ts +++ b/src/new_fields/Proxy.ts @@ -48,23 +48,21 @@ export class ProxyField<T extends RefField> extends ObjectField { private failed = false; private promise?: Promise<any>; - value(callback?: ((field: T | undefined) => void)): T | undefined | FieldWaiting { + value(): T | undefined | FieldWaiting { if (this.cache) { - callback && callback(this.cache); return this.cache; } if (this.failed) { return undefined; } if (!this.promise) { - this.promise = DocServer.getRefField(this.fieldId).then(action((field: any) => { + this.promise = DocServer.GetRefField(this.fieldId).then(action((field: any) => { this.promise = undefined; this.cache = field; if (field === undefined) this.failed = true; return field; })); } - callback && this.promise.then(callback); return this.promise; } } |