SAP 电商云 Spartacus UI ComponentDataProvider defer 工厂函数

简介: SAP 电商云 Spartacus UI ComponentDataProvider defer 工厂函数

image.pngimage.png

为什么 this.componentService.getItems 最后就触发到


Component-data.provider.ts 工厂函数的执行了?


image.png

29行的 getService:


image.pngimage.png



getService 的实现在第 70 行,又会调用到第 79 行的 getContext:


image.png


这里的 componentData,就和之前这篇文章如何在 SAP 电商云 Spartacus UI 里访问 CMS Component data 数据介绍的内容串联起来了。


输入参数:


image.png

首先明确,为什么 defer 里的工厂函数会被执行?一定是因为 defer 返回的 Observable 在某处被 subscribe 了。


getItems -> getService -> getContext -> this.componentData.data$


因为 getItems 被 async pipe 执行,所以 this.componentData.data$ 被 subscribe.


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


相关文章
|
5月前
|
前端开发 JavaScript API
SAP UI5 sap.ui.require.toUrl 的作用介绍
SAP UI5 sap.ui.require.toUrl 的作用介绍
|
5月前
|
JSON 前端开发 测试技术
SAP UI5 sap.ui.core.util.MockServer.simulate 方法介绍
SAP UI5 sap.ui.core.util.MockServer.simulate 方法介绍
使用 SAP UI5 Event Bus 机制,修复 SAP UI5 分页显示数据的一个 bug 试读版
使用 SAP UI5 Event Bus 机制,修复 SAP UI5 分页显示数据的一个 bug 试读版
|
5月前
|
监控 测试技术
SAP 电商云修改 Product Catalog Staged 版本数据后,同步到 online 版本的 UI 操作
SAP 电商云修改 Product Catalog Staged 版本数据后,同步到 online 版本的 UI 操作
|
5月前
|
存储 监控 数据库
SAP 电商云 product catalog 从 staged 到 online 两个版本之间的同步
SAP 电商云 product catalog 从 staged 到 online 两个版本之间的同步
|
5月前
|
监控 安全 数据管理
SAP 电商云 Product catalog 的 staged 和 online 两种版本的设计理念
SAP 电商云 Product catalog 的 staged 和 online 两种版本的设计理念
什么是 SAP ABAP 里的 Subscreen
什么是 SAP ABAP 里的 Subscreen
什么是 SAP ABAP 里的 Subscreen
|
5月前
|
中间件
SAP UI5 Tooling 实战:动手创建自己的 Custom UI5 Server Middleware 试读版
SAP UI5 Tooling 实战:动手创建自己的 Custom UI5 Server Middleware 试读版
SAP UI5 Tooling 实战:动手创建自己的 Custom UI5 Server Middleware 试读版
|
5月前
|
JSON 数据格式
SAP UI5 Class sap.ui.model.Context 的作用介绍
SAP UI5 Class sap.ui.model.Context 的作用介绍
|
5月前
|
存储 缓存 前端开发
关于 SAP Spartacus Optimization Engine 里的 cache 参数使用注意事项
关于 SAP Spartacus Optimization Engine 里的 cache 参数使用注意事项
下一篇
无影云桌面