summaryrefslogtreecommitdiff
path: root/tests/a_case_of_the_splits.ur
blob: 2029729e27471f7734f52336bfa8ea1e90ba54d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fun newCounter () : transaction xbody =
  x <- source 0;
  return <xml>
    <dyn signal={n <- signal x; return <xml>{[n]}</xml>}/>
  </xml>

fun main () : transaction page =
  ls <- source ([] : list xbody);
  return <xml>
    <body>
      <button value="Add" onclick={fn _ =>
        l <- get ls;
        c <- newCounter ();
        set ls (c :: l)}/>
      <dyn signal={l <- signal ls; return <xml>{[l]}</xml>}/>
    </body>
  </xml>