我有一个角度6的应用程序,其中使用了懒惰的加载。我的文件夹结构如下:
src
app
main
products
invoices
customers
suppliers
core
header
footer
services
core.module.ts
shared
app-routing.module.ts
app.component.html
app.component.css
app.component.spec.ts
app.component.ts
我按照推荐的文件夹结构进行延迟加载(此处,每个文件夹位于
main
文件夹是它自己的模块部分)。
如果我想合并
ngrx
,我看到了关于在哪里包括商店、减速器等的不同意见。我读到的一篇文章说要添加一个
store
文件夹中包含所有NGRX部件。我读到的另一篇文章说要在每个模块/部分添加NGRX片段。
这里还有另一篇StackOverflow文章:
What is the best structure for app using ngrx?
这谈到了ngrx文件夹结构,但没有提到延迟加载。
当使用延迟加载时,是否有建议的构造NGRX的方法?在每个模块中添加一个包含减速器、动作等的商店,或者创建一个包含所有内容的大型商店文件夹,是否更有意义?这个应用程序不太大,它更像是一个中等大小的应用程序。
谢谢!