Current
html.div([], [
html.button([event.on_click(Increment)], [
element.text("+")
]),
element.text(count),
html.button([event.on_click(Decrement)], [
element.text("-")
]),
])
Function chaining (typescript/similar)
html
.div()
.children(
html
.button()
.on_click(Increment)
.text("+"),
html
.button()
.on_click(Decrement)
.text("-"),
)
Equivalent of function chaining for Gleam
html.div()
|> attr.children([
html.button()
|> attr.on_click(Increment)
|> attr.text("-"),
html.button()
|> attr.on_click(Increment)
|> attr.text("+"),
])