Loom: A component framework for Go.

After four months in the making, I'm really excited to announce loom. The first signal-based component framework in Go, that can be used for the Web, the Terminal, and more. func Counter() Node { c...

By · · 1 min read
Loom: A component framework for Go.

Source: DEV Community

After four months in the making, I'm really excited to announce loom. The first signal-based component framework in Go, that can be used for the Web, the Terminal, and more. func Counter() Node { count, setCount := Signal(0) go func() { for { time.Sleep(time.Second / 30) setCount(count() + 1) } }() return P(Text("Count: "), BindText(count)) } What is loom? Loom is a component framework. It's similar to modern versions of SolidJS or SvelteJS, but in Go and with a few twists: 1) Markup is just Go functions. Markup is not written in HTML, using templating, or in a separate JSX-like syntax that would require extra tooling. Instead, it's just plain Go. A component is simply a function that returns a loom.Node, optionally taking children as arguments. func MyComponent(children ...loom.Node) loom.Node { // ... } Since markup is just Go functions, it can be used and written however it fits you best to construct a complete UI. For instance creating a Card() component with a title and a body: fu

Similar Topics

#ai (16747) #machine learning (14680) #programming (3999) #hands on tutorials (1874) #open source (1686) #security (717) #coding (592) #webdev (254) #supply chain security (245) #javascript (229) #codeql (106) #retrieval augmented (84) #react (63) #json (36) #apple m3 (7) #aws cli (7) #setup guide (7) #wen_yang (7) #developer skills (570) #performance (103)

Related Posts

Trending on ShareHub

Latest on ShareHub

Browse Topics

#artificial intelligence (31552) #data science (24017) #ai (16738) #generative ai (15034) #crypto (14987) #machine learning (14680) #bitcoin (14229) #featured (13550) #news & insights (13064) #crypto news (11082)

Around the Network