Skip to content

Instantly share code, notes, and snippets.

@Aqua-Ye
Created September 20, 2012 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Aqua-Ye/3755095 to your computer and use it in GitHub Desktop.
Save Aqua-Ye/3755095 to your computer and use it in GitHub Desktop.
database int /counter;
function apply(f) {
/counter = Int.apply(#counter, f);
}
function page(){
<h1 id=#counter>0</h1>
<h1><span onclick={apply(++)}>+</span> <span onclick={apply(--)}>-</span></h1>
}
Server.start(Server.http, { title: "counter", ~page })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment