comparison tests/active.ur @ 1786:d794149b3713

<active>
author Adam Chlipala <adam@chlipala.net>
date Sat, 21 Jul 2012 13:55:35 -0400
parents
children
comparison
equal deleted inserted replaced
1785:ffd7ed3bc0b7 1786:d794149b3713
1 fun counter' () =
2 s <- source 0;
3 return <xml>
4 <dyn signal={n <- signal s; return (txt n)}/>
5 <button onclick={fn _ => n <- get s; set s (n + 1)}/>
6 </xml>
7
8 fun counter () = <xml><active code={counter' ()}/></xml>
9
10 fun main () : transaction page = return <xml><body>
11 {counter ()}
12 <hr/>
13 {counter ()}
14 </body></xml>