summaryrefslogtreecommitdiff
path: root/tests/active.ur
diff options
context:
space:
mode:
Diffstat (limited to 'tests/active.ur')
-rw-r--r--tests/active.ur14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/active.ur b/tests/active.ur
new file mode 100644
index 00000000..e5fa68db
--- /dev/null
+++ b/tests/active.ur
@@ -0,0 +1,14 @@
+fun counter' () =
+ s <- source 0;
+ return <xml>
+ <dyn signal={n <- signal s; return (txt n)}/>
+ <button onclick={fn _ => n <- get s; set s (n + 1)}/>
+ </xml>
+
+fun counter () = <xml><active code={counter' ()}/></xml>
+
+fun main () : transaction page = return <xml><body>
+ {counter ()}
+ <hr/>
+ {counter ()}
+</body></xml>