-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
50 lines (50 loc) · 2.15 KB
/
index.html
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<html>
<head>
<script async src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js" crossorigin="anonymous"></script>
<script type="importmap">
{
"imports": {
"phx-live-state": "https://ga.jspm.io/npm:[email protected]/build/src/index.js",
"sprae": "https://ga.jspm.io/npm:[email protected]/src/index.js",
"template-parts": "https://ga.jspm.io/npm:[email protected]/template-parts.js",
"templize/templize.js": "https://ga.jspm.io/npm:[email protected]/templize.js",
"wc-context": "https://ga.jspm.io/npm:[email protected]/core.js"
},
"scopes": {
"https://ga.jspm.io/": {
"@preact/signals-core": "https://ga.jspm.io/npm:@preact/[email protected]/dist/signals-core.module.js",
"element-props": "https://ga.jspm.io/npm:[email protected]/element-props.js",
"json-joy/esm/json-patch": "https://ga.jspm.io/npm:[email protected]/esm/json-patch/index.js",
"phoenix": "https://ga.jspm.io/npm:[email protected]/priv/static/phoenix.mjs",
"process": "https://ga.jspm.io/npm:@jspm/[email protected]/nodelibs/browser/process.js",
"reflect-metadata": "https://ga.jspm.io/npm:[email protected]/Reflect.js",
"sube": "https://ga.jspm.io/npm:[email protected]/sube.js",
"subscript": "https://ga.jspm.io/npm:[email protected]/subscript.js",
"subscript/parse.js": "https://ga.jspm.io/npm:[email protected]/parse.js"
}
}
}
</script>
<script type="module">
import './src/live-template.js'
</script>
</head>
<body>
<live-template url="ws://localhost:4000/live_state" topic="todo:all" provide-context="mrstate">
<template>
<ul>
<li :each="todo in todos" :text="todo">
</ul>
<form @submit="sendEvent('add-todo', event)">
<label>Todo item</label>
<input :value="new_todo" name="todo" />
<button>Add todo</button>
</form>
</template>
<div>some fallback content</div>
</live-template>
<live-template consume-context="mrstate">
<div :each="todo in todos" :text="todo"></div>
</live-template>
</body>
</html>