我看教程,是:
/store/index.ts
/store/modules/a.ts
/store/modules/b.ts
a.ts 和 b.ts 中,分别有各自的 action,reducer 。 这样的目录结构。
我以前做 App 的习惯相当于是:
/store/index.ts
/modules/A/a.ts 、A.modules.scss 、A.tsx...
/modules/B/b.ts 、B.modules.scss 、B.tsx...
喜欢把和 A 有关的东西,尽量都塞在 A 里面。
不过毕竟其实 App 没有这个 /store/index.ts 。
前者的优势在?
单纯的习惯问题?