
11 月 2 日 · 8 分钟

本期节目主要介绍了请求数据时常遇到的问题以及React框架下的几种解决方案。最后,我们将介绍本期的主角React Query,包括它的设计和功能。
如果有任何意见和建议可以发邮件至 [email protected]
如果愿意加入我们的 discord 社区可以点击这里: https://discord.gg/TQczjSJMah
主播
AnnatarHe: https://annatarhe.com
Timeline
开场,确实鸽了段时间
在 discord 上开了个社区,想来聊天可以加
请求数据,不像说的那么简单
loading 说起来容易,做起来麻烦
in/revalidation 也挺麻烦的
cancel 也不好处理
有 devtool 的话,会比想象中更方便
把前后端交互做好,下班时间(也许会)显著提前
ahooks 陪跑
apollo client 仅限于 GraphQL
SWR
SWR 翻页数据有想法
React Query
Mutation 的支持
对 TypeScript 的支持较好
不要 debounce 了,直接取消请求吧
甚至支持直接生成 GraphQL
devtool 要比预想中的好用很多
ReactQuery 的 cache 要是能更强一点儿就更好了
使用 ReactQuery 记得至少分两层架构
实现不难,难的是怎么想出来的
有想法就去实现,下一个万 star 项目属于你
相关链接
AsyncTalk 的 discord 社群: https://discord.gg/8XXfh6jh
Document: visibilitychange event**:** https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilitychange_event
AbortController: https://developer.mozilla.org/en-US/docs/Web/API/AbortController
React.Suspense: https://beta.reactjs.org/reference/react/Suspense
ahooks.useRequest: https://ahooks.js.org/hooks/use-request/index
apollo client: https://github.com/apollographql/apollo-client
SWR: https://swr.vercel.app/zh-CN
ReactQuery 对 TypeScript 的支持: https://tanstack.com/query/v4/docs/react/typescript
ReactQuery 对于 GraphQL 的集成与支持: https://tanstack.com/query/v4/docs/react/graphql�
勘误
SWR 2.0 支持了 Mutation: https://swr.vercel.app/zh-CN/blog/swr-v2#useswrmutation
BGM by Otologic
说明里标出的时间点,点一下跳过去

11 月 2 日 · 8 分钟

10 月 26 日 · 6 分钟

10 月 16 日 · 12 分钟

10 月 8 日 · 6 分钟

AsyncTalk · 2023 年 2 月 27 日 · 20 分钟
本期节目主要介绍了请求数据时常遇到的问题以及React框架下的几种解决方案。最后,我们将介绍本期的主角React Query,包括它的设计和功能。
如果有任何意见和建议可以发邮件至 [email protected]
如果愿意加入我们的 discord 社区可以点击这里: https://discord.gg/TQczjSJMah
主播
AnnatarHe: https://annatarhe.com
Timeline
开场,确实鸽了段时间
在 discord 上开了个社区,想来聊天可以加
请求数据,不像说的那么简单
loading 说起来容易,做起来麻烦
in/revalidation 也挺麻烦的
cancel 也不好处理
有 devtool 的话,会比想象中更方便
把前后端交互做好,下班时间(也许会)显著提前
ahooks 陪跑
apollo client 仅限于 GraphQL
SWR
SWR 翻页数据有想法
React Query
Mutation 的支持
对 TypeScript 的支持较好
不要 debounce 了,直接取消请求吧
甚至支持直接生成 GraphQL
devtool 要比预想中的好用很多
ReactQuery 的 cache 要是能更强一点儿就更好了
使用 ReactQuery 记得至少分两层架构
实现不难,难的是怎么想出来的
有想法就去实现,下一个万 star 项目属于你
相关链接
AsyncTalk 的 discord 社群: https://discord.gg/8XXfh6jh
Document: visibilitychange event**:** https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilitychange_event
AbortController: https://developer.mozilla.org/en-US/docs/Web/API/AbortController
React.Suspense: https://beta.reactjs.org/reference/react/Suspense
ahooks.useRequest: https://ahooks.js.org/hooks/use-request/index
apollo client: https://github.com/apollographql/apollo-client
SWR: https://swr.vercel.app/zh-CN
ReactQuery 对 TypeScript 的支持: https://tanstack.com/query/v4/docs/react/typescript
ReactQuery 对于 GraphQL 的集成与支持: https://tanstack.com/query/v4/docs/react/graphql�
勘误
SWR 2.0 支持了 Mutation: https://swr.vercel.app/zh-CN/blog/swr-v2#useswrmutation
BGM by Otologic
说明里标出的时间点,点一下跳过去

http://www.ximalaya.com/album/53875103.xml复制内容版权归创作者,声湃按创作者开放的 RSS 收录。了解收录与 RSS →

11 月 2 日 · 8 分钟

10 月 26 日 · 6 分钟

10 月 16 日 · 12 分钟