aboutsummaryrefslogtreecommitdiff
path: root/src/Server.tsx
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-02-07 23:33:44 -0500
committerTyler Schicke <tyler_schicke@brown.edu>2019-02-07 23:33:44 -0500
commit9b942166ca6b09ce4f310928c3daf8503a63ee5c (patch)
treecec530ff1bf61f02f3d1a9e722325d78aa935d70 /src/Server.tsx
parent090093a50397ddc2a8fc2c50f5097f4a4ea8a74c (diff)
Restored Opt<T> and made a new FieldValue<T> type to replace old Opt<T>
Diffstat (limited to 'src/Server.tsx')
-rw-r--r--src/Server.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Server.tsx b/src/Server.tsx
index 04473424a..08e400619 100644
--- a/src/Server.tsx
+++ b/src/Server.tsx
@@ -1,4 +1,4 @@
-import { Field, FieldWaiting, FIELD_ID, DOC_ID, FIELD_WAITING } from "./fields/Field"
+import { Field, FieldWaiting, FIELD_ID, DOC_ID, FIELD_WAITING, FieldValue } from "./fields/Field"
import { Key, KeyStore } from "./fields/Key"
import { ObservableMap, computed, action, observable } from "mobx";
import { Document } from "./fields/Document"
@@ -44,7 +44,7 @@ export class Server {
@action
- public static GetDocumentField(doc: Document, key: Key) {
+ public static GetDocumentField(doc: Document, key: Key): FieldValue<Field> {
var fieldid = doc._proxies.get(key);
if (!this.ClientFieldsCached.has(fieldid)) {
this.ClientFieldsCached.set(fieldid, FieldWaiting);
@@ -72,8 +72,8 @@ export class Server {
public static SEND_DOCUMENT_FIELD_REQUEST(doc: Document, key: Key, fieldid: FIELD_ID) {
//simulating a server call with a registered callback action
- setTimeout(() => this.receivedDocumentField(doc, key, fieldid, this.FieldStore.get(fieldid)),
- key == KeyStore.Data ? (this.times++ == 0 ? 5000 : 1000) : key == KeyStore.X ? 2500 : 500
+ setTimeout(() => this.receivedDocumentField(doc, key, fieldid, this.FieldStore.get(fieldid)), 50
+ // key == KeyStore.Data ? (this.times++ == 0 ? 5000 : 1000) : key == KeyStore.X ? 2500 : 500
)
}
@@ -82,7 +82,7 @@ export class Server {
this.receivedDocument(docid, this.DocumentStore.get(docid)!)
} else {
//simulating a server call with a registered callback action
- setTimeout(() => this.receivedDocument(docid, this.DocumentStore.get(docid)!), 1500);
+ setTimeout(() => this.receivedDocument(docid, this.DocumentStore.get(docid)!), 50);
}
}