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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Sneak Peek: Beyond React 16 [video]

89 点作者 montogeek大约 7 年前

4 条评论

aeontech大约 7 年前
Video of Dan Abramov&#x27;s demo here: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=v6iR3Zk4oDY" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=v6iR3Zk4oDY</a><p>and associated HN discussion here: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16492973" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16492973</a>
评论 #16495485 未加载
评论 #16494924 未加载
egeozcan大约 7 年前
As far as I understand:<p>If you throw a promise (throw as in throwing an error) from the render function, React will retry when it resolves. `createFetcher` is a cache layer so that you don&#x27;t DOS your own server on re-renders. Maybe though encouraging people use a ServiceWorker for that would have made more sense (edit: it also throws the promise for you when you access the cached value. so, yeah, it is very well-thought indeed).<p>Apart from that, this seems to be very simple to use, well-thought and useful.
评论 #16495764 未加载
daveroberts大约 7 年前
This is very cool. I&#x27;m heavily invested in Vue.js, but seeing these kinds of features of the horizon with React makes me a bit jealous.<p>The APIs do see unintuitive, but as Dan said, they are not finalized yet. I remember trying to implement a drag and drop component in React and having a bit of trouble with complicated APIs. Hopefully this keeps getting cleaner.
vga805大约 7 年前
I&#x27;m eager to play with this and to try out some ideas.<p>For example, I wonder if it&#x27;s possible to pass createFetcher an async function that awaits a fetch, dispatches a redux action with the data as a payload, then returns the data. If create fetcher works this way, it would seem to obviate a bunch of the usual redux actions. instead of FETCH_DATA, FETCH_DATA_SUCCESS, and FETCH_DATA_FAILURE, you could just have something like SET_DATA.