angular - Redux 和 3rd 方库
问题描述
我们正在构建一个管理面板,我们以 ngx-admin 为基础。
我想在项目中使用@ngxs/store。但是管理面板有 3rd 方库和组件,它们不能以 redux 方式工作。
我应该使用 @ngxs/store 吗?如何控制来自 3rd 方库的操作?或者 @ngxs/store 是否需要不使用 3rd 方组件的项目?
例如,它使用 ng2-smart-table。表格有排序、过滤等。所有这些动作都应该是一个 redux 动作,并且它们应该有适当的 reducer。但是该组件已准备好使用,并且对全局状态一无所知,也没有任何方法可以使用它...
所以,问题是,我应该使用 @ngxs/store,还是应该使用原生 Angular 并仅将 Redux 留给自己编写的应用程序,而不使用 3rd 方库?
解决方案
The answer is: it depends.
If you want to implement Redux and keep track of everything you will need to create actions yourself for 3rd party components. But keep in mind that for a table you might not need actions for everything, and store only the rows data you are going to display.
推荐阅读
- oracle - INSERT AS SELECT 在表有修订的包中
- linkedin - 无法通过 API 创建具有 VIDEO 类型的 ugc 帖子
- apache - Hacked : 如何知道我们的服务器第一次调用 pirate 的 url 的日期?
- vue.js - VueJS 条件渲染第一次没有重新渲染
- python - Python csv文件到数据字典多个键
- c++ - 如何让 C++ 模板类调用另一个类的方法?
- xml - 如何设计微调器的这个 XML 文件
- c# - 使用纬度和经度识别位置的邮政编码
- amazon-ami - VMWARE 导入打包程序作业卡在“开始重命名 AMI”
- javascript - 我可以仅使用 Javascript 代码拖动 DOM 元素吗?(比如如果我用鼠标拖动它)