diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-03-18 22:04:52 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-03-18 22:04:52 -0400 |
commit | 0f55a6dd53633158e796374829ff0df81d589fee (patch) | |
tree | 49cffbc0a5920d417e3c23d6e7a3898f979a44d6 /src/fields/Document.ts | |
parent | 76a415fc2bc967202027015efdcffdcb5fc511ba (diff) | |
parent | 700d10e7bdba9e6536b8a5616fc333c11e1ed289 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/fields/Document.ts')
-rw-r--r-- | src/fields/Document.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fields/Document.ts b/src/fields/Document.ts index be0137128..b6439364a 100644 --- a/src/fields/Document.ts +++ b/src/fields/Document.ts @@ -249,6 +249,13 @@ export class Document extends Field { } @action + SetDataOnPrototype<T, U extends Field & { Data: T }>(key: Key, value: T, ctor: { new(): U }, replaceWrongType = true) { + this.GetAsync(KeyStore.Prototype, (f: Field) => { + (f as Document).SetData(key, value, ctor) + }) + } + + @action SetData<T, U extends Field & { Data: T }>(key: Key, value: T, ctor: { new(): U }, replaceWrongType = true) { let field = this.Get(key, true); |