-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
29 lines (25 loc) · 772 Bytes
/
index.html
File metadata and controls
29 lines (25 loc) · 772 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
28
29
<!DOCTYPE html>
<html>
<head>
<title>Deepstream Chat</title>
<script src="https://cdn.deepstream.io/js/client/latest/ds.min.js"></script>
</head>
<body>
<input type="text" />
<script type="text/javascript">
window.onload = function () {
const { DeepstreamClient } = window.DeepstreamClient;
const client = new DeepstreamClient("localhost:5500");
client.login();
const record = client.record.getRecord("some-name");
const input = document.querySelector("input");
input.onkeyup = function () {
record.set("firstname", input.value);
};
record.subscribe("firstname", function (value) {
input.value = value;
});
};
</script>
</body>
</html>