aboutsummaryrefslogtreecommitdiff
path: root/src/client/Server.ts
diff options
context:
space:
mode:
authortschicke-brown <tyler_schicke@brown.edu>2019-02-22 12:36:11 -0500
committerGitHub <noreply@github.com>2019-02-22 12:36:11 -0500
commit85d7a3d9aee44f0b199dddace92f7a683bc33eb6 (patch)
tree1128cba0e4532e1ca9ad5eba8c85cec1c74c2c5a /src/client/Server.ts
parent3f9e4363e6601eac175ff71192d414fd6051d921 (diff)
parentf58c27d102ffbe44eea09ff6e3900292d273a021 (diff)
Merge pull request #9 from browngraphicslab/collectionView
Added CollectionView
Diffstat (limited to 'src/client/Server.ts')
-rw-r--r--src/client/Server.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/Server.ts b/src/client/Server.ts
index 3e61729ab..06ac22c61 100644
--- a/src/client/Server.ts
+++ b/src/client/Server.ts
@@ -60,13 +60,16 @@ export class Server {
});
}
- public static GetDocumentField(doc: Document, key: Key) {
+ public static GetDocumentField(doc: Document, key: Key, callback?: (field: Field) => void) {
let field = doc._proxies.get(key.Id);
if (field) {
this.GetField(field,
action((fieldfromserver: Opt<Field>) => {
if (fieldfromserver) {
doc.fields.set(key.Id, { key, field: fieldfromserver });
+ if (callback) {
+ callback(fieldfromserver);
+ }
}
}));
}