Artwork

Indhold leveret af AsyncTalk. Alt podcastindhold inklusive episoder, grafik og podcastbeskrivelser uploades og leveres direkte af AsyncTalk eller deres podcastplatformspartner. Hvis du mener, at nogen bruger dit ophavsretligt beskyttede værk uden din tilladelse, kan du følge processen beskrevet her https://da.player.fm/legal.
Player FM - Podcast-app
Gå offline med appen Player FM !

EP23 让拉数据,像呼吸一样自然

20:29
 
Del
 

Manage episode 356409028 series 3291831
Indhold leveret af AsyncTalk. Alt podcastindhold inklusive episoder, grafik og podcastbeskrivelser uploades og leveres direkte af AsyncTalk eller deres podcastplatformspartner. Hvis du mener, at nogen bruger dit ophavsretligt beskyttede værk uden din tilladelse, kan du følge processen beskrevet her https://da.player.fm/legal.

本期节目主要介绍了请求数据时常遇到的问题以及React框架下的几种解决方案。最后,我们将介绍本期的主角React Query,包括它的设计和功能。

如果有任何意见和建议可以发邮件至 async.talk@gmail.com

如果愿意加入我们的 discord 社区可以点击这里: https://discord.gg/TQczjSJMah


主播


AnnatarHe: https://annatarhe.com


Timeline


00:00 开场,确实鸽了段时间

00:35 在 discord 上开了个社区,想来聊天可以加

01:20 请求数据,不像说的那么简单

02:15 loading 说起来容易,做起来麻烦

03:20 in/revalidation 也挺麻烦的

05:25 cancel 也不好处理

07:10 有 devtool 的话,会比想象中更方便

07:30 把前后端交互做好,下班时间(也许会)显著提前

08:10 ahooks 陪跑

08:50 apollo client 仅限于 GraphQL

09:30 SWR

10:30 SWR 翻页数据有想法

12:11 React Query

13:23 Mutation 的支持

14:10 对 TypeScript 的支持较好

14:40 不要 debounce 了,直接取消请求吧

16:29 甚至支持直接生成 GraphQL

16:45 devtool 要比预想中的好用很多

17:07 ReactQuery 的 cache 要是能更强一点儿就更好了

18:20 使用 ReactQuery 记得至少分两层架构

19:00 实现不难,难的是怎么想出来的

20:12 有想法就去实现,下一个万 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

  continue reading

43 episoder

Artwork
iconDel
 
Manage episode 356409028 series 3291831
Indhold leveret af AsyncTalk. Alt podcastindhold inklusive episoder, grafik og podcastbeskrivelser uploades og leveres direkte af AsyncTalk eller deres podcastplatformspartner. Hvis du mener, at nogen bruger dit ophavsretligt beskyttede værk uden din tilladelse, kan du følge processen beskrevet her https://da.player.fm/legal.

本期节目主要介绍了请求数据时常遇到的问题以及React框架下的几种解决方案。最后,我们将介绍本期的主角React Query,包括它的设计和功能。

如果有任何意见和建议可以发邮件至 async.talk@gmail.com

如果愿意加入我们的 discord 社区可以点击这里: https://discord.gg/TQczjSJMah


主播


AnnatarHe: https://annatarhe.com


Timeline


00:00 开场,确实鸽了段时间

00:35 在 discord 上开了个社区,想来聊天可以加

01:20 请求数据,不像说的那么简单

02:15 loading 说起来容易,做起来麻烦

03:20 in/revalidation 也挺麻烦的

05:25 cancel 也不好处理

07:10 有 devtool 的话,会比想象中更方便

07:30 把前后端交互做好,下班时间(也许会)显著提前

08:10 ahooks 陪跑

08:50 apollo client 仅限于 GraphQL

09:30 SWR

10:30 SWR 翻页数据有想法

12:11 React Query

13:23 Mutation 的支持

14:10 对 TypeScript 的支持较好

14:40 不要 debounce 了,直接取消请求吧

16:29 甚至支持直接生成 GraphQL

16:45 devtool 要比预想中的好用很多

17:07 ReactQuery 的 cache 要是能更强一点儿就更好了

18:20 使用 ReactQuery 记得至少分两层架构

19:00 实现不难,难的是怎么想出来的

20:12 有想法就去实现,下一个万 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

  continue reading

43 episoder

Alle episoder

×
 
Loading …

Velkommen til Player FM!

Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.

 

Hurtig referencevejledning