Redux Vuex ngrx for Remote API仅读取数据

发布于 2025-02-01 23:53:56 字数 317 浏览 3 评论 0原文

我需要一些帮助了解状态管理(Redux/vuex/ngrx)的使用来查询远程API,这些API主要包含仅阅读数据以进行演示。这与诸如跟踪收藏夹,我的购物车等之类的应用程序内状态相反。大多数国家管理层的示例都是基本的,并且没有解释这一点。

假设我需要来自远程数据存储/API的数据,在某些情况下我可能不是所有者,或者它们可能是长期运行的异步过程的一部分。地方国家管理是否适当用途?

示例:远程新闻提要API。应用程序用户不太可能对此“写”。它可能包含数千个新闻报道。使用更传统的服务来从API获取内容是适当的,但是将州管理用于本地内置状态,还是在国家管理上全力以赴,而我只是缺少一些东西?谢谢。

I need some help understanding the use of state management (Redux/Vuex/NGRX) for querying remote APIs that contain mostly read-only data for presentation. This is opposed to in-app state such as keeping track of favorites, my shopping cart, etc. Most examples on state management are pretty basic and don't explain this.

Let's say I need data from a remote data store/API that in some cases I may not be the owner of, or they may be part of a long-running asynchronous process. Is local state management an appropriate use?

Example: A remote NEWS feed API. Not likely an application user would ever 'write' to it. It may contain thousands of news stories. Would it be appropriate to use a more traditional service to fetch stuff from the API for this, but use state management for local in-app state, or is it really better to go all-in on state management and I am just missing something? Thanks.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文