summaryrefslogtreecommitdiff
path: root/tests/active.ur
blob: e5fa68db9a6aea727350c81b60a5d7f62e1ed462 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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>