import { app, html } from "flea"

const model = 0

const view = (model, dispatch) => html`
    <div>
        <h1>${model}</h1>
        <button onclick=${_ => dispatch("INCREMENT")}>+</button>
        <button onclick=${_ => dispatch("DECREMENT")}>-</button>
    </div>`

const update = {
    INCREMENT: model => model + 2,
    DECREMENT: model => model - 1
}

app(model, view, update)
@@ -98,34 +98,8 @@
 iv%3E%0A
-        %3Ch1%3E$%7Bmodel%7D%3C/h1%3E%0A
     
@@ -155,24 +155,48 @@
 %3E+%3C/button%3E%0A
+        %3Cp%3E$%7Bmodel%7D%3C/p%3E%0A
         %3Cbut
@@ -236,16 +236,39 @@
 EMENT%22)%7D
+ disabled=$%7Bmodel %3C= 0%7D
 %3E-%3C/butt
@@ -337,9 +337,9 @@
 l + 
-2
+1
 ,%0A  

Increment by one. Show how to use disabled attribute with boolean var.