docs: update readme

This commit is contained in:
Joao Goncalves
2025-11-03 00:49:32 -01:00
parent 905f1dc5da
commit 61ce1d4258

View File

@@ -32,17 +32,17 @@ func main() {
v := via.New() v := via.New()
v.Page("/", func(c *via.Context) { v.Page("/", func(c *via.Context) {
s := Counter{Count: 0} data := Counter{Count: 0}
step := c.Signal(1) step := c.Signal(1)
increment := c.Action(func() { increment := c.Action(func() {
s.Count += step.Int() data.Count += step.Int()
c.Sync() c.Sync()
}) })
c.View(func() h.H { c.View(func() h.H {
return h.Div( return h.Div(
h.P(h.Textf("Count: %d", s.Count)), h.P(h.Textf("Count: %d", data.Count)),
h.Label( h.Label(
h.Text("Update Step: "), h.Text("Update Step: "),
h.Input(h.Type("number"), step.Bind()), h.Input(h.Type("number"), step.Bind()),