- SAP Commerce Accelerator和SAP Spa
- SAP Commerce Cloud Spartacus UI
- SAP Commerce Cloud Spartacus UI
- SAP Commerce Cloud Spartacus UI
- SAP Commerce Cloud Spartacus UI
- SAP Commerce Cloud Spartacus UI
- SAP Commerce Cloud Spartacus UI
- SAP Commerce Cloud Spartacus UI
- 如何在 SAP 电商云 Spartacus UI 里新建一个页面
- 网站上的 breadcrumb 使用场景浅析
在 components.reducer.ts 里,loaderReducer 函数,会根据输入的 entityType,返回一阶 reducer.

然后在代码第86行,调用该一阶 reducer 进行状态转换,返回新的状态。
在 cms store reducers index.ts 里,该 reducer 被导入,见代码第21行:

然后,在第49行,调用 entityReducer,给 COMPONENT_ENTITY 类型生产一个新的 reducer 函数。

这个新的 reducer 的函数体:

getReducer 在何时会被调用?

除了 index.ts 之外,其他都是单元测试代码:

通过工厂方法 + injection token 的方式暴露给外部:

最后被导入到 CmsStore module 的 providers 区域里即可:

更多Jerry的原创文章,尽在:"汪子熙":

网友评论