是否需要在Redux中使用中间件?如果正在使用RTK查询

发布于 2025-01-21 10:44:09 字数 73 浏览 2 评论 0原文

如果我使用外部API或从数据库中获取数据,那么我是否需要在Redux Toolkit或RTK查询中使用中间件可以为我完成所有工作吗?

If I am using an external api or fetching data from database then is there any need for me to use middleware in redux toolkit or RTK query can do all the work for me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赠佳期 2025-01-28 10:44:09

我在他们的官方RTK用户指南文档中找到了这一点:

用户指南| Redux工具包

Redux Toolkit的RTK查询数据获取API是一个专用的数据
REDUX应用程序的获取和缓存解决方案,可以消除
需要编写任何thunk或缩小器来管理数据获取。

I found this on their the official RTK User Guide Docs:

User Guide | Redux Toolkit

Redux Toolkit's RTK Query data fetching API is a purpose built data
fetching and caching solution for Redux apps, and can eliminate the
need to write any thunks or reducers to manage data fetching.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文