diff options
| author | bob <bcz@cs.brown.edu> | 2019-07-30 09:41:08 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-07-30 09:41:08 -0400 |
| commit | fe2ae4e235a12198a530672d4db3fdcd167c6e65 (patch) | |
| tree | f44fbc2b53eba3eadc51b851600b706c0e451d5a /src/new_fields/Proxy.ts | |
| parent | 5591060e868053c8839fcc1de1ae77d4dac361ac (diff) | |
| parent | e041988b84553797699a5a232e26e72252460e01 (diff) | |
Merge branch 'master' into youtube-api-muhammed
Diffstat (limited to 'src/new_fields/Proxy.ts')
| -rw-r--r-- | src/new_fields/Proxy.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/new_fields/Proxy.ts b/src/new_fields/Proxy.ts index 14f08814e..b3e8d6467 100644 --- a/src/new_fields/Proxy.ts +++ b/src/new_fields/Proxy.ts @@ -6,6 +6,7 @@ import { DocServer } from "../client/DocServer"; import { RefField } from "./RefField"; import { ObjectField } from "./ObjectField"; import { Id, Copy, ToScriptString } from "./FieldSymbols"; +import { scriptingGlobal } from "../client/util/Scripting"; @Deserializable("proxy") export class ProxyField<T extends RefField> extends ObjectField { @@ -66,3 +67,12 @@ export class ProxyField<T extends RefField> extends ObjectField { return this.promise as any; } } + +function prefetchValue(proxy: PrefetchProxy<RefField>) { + return proxy.value() as any; +} + +@scriptingGlobal +@Deserializable("prefetch_proxy", prefetchValue) +export class PrefetchProxy<T extends RefField> extends ProxyField<T> { +} |
