Settings

Theme

Show HN: A directed acyclic graph for managing state in SPA's

github.com

1 points by bbsimonbb 2 years ago · 1 comment

Reader

bbsimonbbOP 2 years ago

I found state management too boilerplatey and full of concepts. I thought the distinction between state and computed was unhelpful, and I thought the methods were all over the place. I remarked that the subjects our UIs handle generally have a completely stable structure, and this structure is a directed acyclic graph.

So I decided "I'm going to make a directed acyclic graph that hosts everything: your state, your UI oninput handlers, your data fetching. That way, your state lives with the methods that modify it, in nodes, and everything will be consistent all the time, because the graph will know which nodes to recalculate when any node changes. Then as a bonus, we'll be able to visualize the emergent structure of our apps, live, in a super devtools."

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection