TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

1 点作者 bbsimonbb超过 1 年前

1 comment

bbsimonbb超过 1 年前
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;