Signal drop!
Relay (operand.online) is unreachable.
Usually, a dropped signal means an upgrade is happening. Hold on!
Sorry, no connección.
Hang in there while we get back on track
gram:panel
> ./src/panel.gleam
Lenses
(coming soon!)
import gleam/int
import lustre
import lustre/element.{text}
import lustre/element/html.{div, button, p}
import lustre/event.{on_click}
pub fn main() {
let app = lustre.simple(init, update, view)
let assert Ok(_) = lustre.start(app, "#base", Nil)
Nil
}
fn init(_) { 0 }
type Msg {
Incr
Decr
}
fn update(model, msg) {
case msg {
Incr -> model + 1
Decr -> model - 1
}
}
fn view(model) {
let count = int.to_string(model)
div([], [
div([], [text("shiny.")]),
button([on_click(Decr)], [text(" - ")]),
p([], [text(count)]),
button([on_click(Incr)], [text(" + ")])
])
}