diff options
| author | yipstanley <stanley_yip@brown.edu> | 2019-02-26 16:33:53 -0500 |
|---|---|---|
| committer | yipstanley <stanley_yip@brown.edu> | 2019-02-26 16:33:53 -0500 |
| commit | 59cc888c8bf0559c50e12fd2774ea5ac4ebb3059 (patch) | |
| tree | 01c88fb348d4431c017d9546f0840f37235dd1ba /src/fields | |
| parent | 8d2dc530854517830dc55d7f7a0f02828bd7f8f6 (diff) | |
basic implementation of prototype/delegate stuff
Diffstat (limited to 'src/fields')
| -rw-r--r-- | src/fields/Document.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/fields/Document.ts b/src/fields/Document.ts index 823991759..39648a950 100644 --- a/src/fields/Document.ts +++ b/src/fields/Document.ts @@ -2,7 +2,7 @@ import { Key } from "./Key" import { KeyStore } from "./KeyStore"; import { Field, Cast, FieldWaiting, FieldValue, FieldId } from "./Field" import { NumberField } from "./NumberField"; -import { ObservableMap, computed, action } from "mobx"; +import { ObservableMap, computed, action, runInAction } from "mobx"; import { TextField } from "./TextField"; import { ListField } from "./ListField"; import { Server } from "../client/Server"; @@ -210,6 +210,13 @@ export class Document extends Field { return protos; } + CreateAlias(id?: string): Document { + let alias = new Document(id) + alias.Set(KeyStore.Prototype, this) + + return alias + } + MakeDelegate(id?: string): Document { let delegate = new Document(id); |
