-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (24 loc) · 824 Bytes
/
index.js
File metadata and controls
27 lines (24 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//
// Replace this url with the url to your Convergence Server
const BASE_URL = "http://localhost:8080";
const DOMAIN = "convergence/default";
const DOMAIN_URL = `${BASE_URL}/${DOMAIN}`;
Convergence.connectAnonymously(DOMAIN_URL)
.then((domain) => {
return domain.models().openAutoCreate({
collection: "input-binder",
id: "test2",
data: () => {
return {textInput: "Text to collaborate on"};
}
});
})
.then((model) => {
const textInput = document.getElementById("textInput");
textInput.disabled = false;
const realTimeString = model.elementAt("textInput");
ConvergenceInputElementBinder.bindTextInput(textInput, realTimeString);
})
.catch((error) => {
console.error(error);
});