TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

1 pointsby bbsimonbbover 1 year ago

1 comment

bbsimonbbover 1 year 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.<p>So I decided &quot;I&#x27;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&#x27;ll be able to visualize the emergent structure of our apps, live, in a super devtools.&quot;