SAP 电商云 Spartacus UI ComponentDataProvider defer 工厂函数
生活随笔
收集整理的這篇文章主要介紹了
SAP 电商云 Spartacus UI ComponentDataProvider defer 工厂函数
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
為什么 this.componentService.getItems 最后就觸發到
Component-data.provider.ts 工廠函數的執行了?
29行的 getService:
getService 的實現在第 70 行,又會調用到第 79 行的 getContext:
這里的 componentData,就和之前這篇文章如何在 SAP 電商云 Spartacus UI 里訪問 CMS Component data 數據介紹的內容串聯起來了。
輸入參數:
首先明確,為什么 defer 里的工廠函數會被執行?一定是因為 defer 返回的 Observable 在某處被 subscribe 了。
getItems -> getService -> getContext -> this.componentData.data$
因為 getItems 被 async pipe 執行,所以 this.componentData.data$ 被 subscribe.
更多Jerry的原創文章,盡在:“汪子熙”:
總結
以上是生活随笔為你收集整理的SAP 电商云 Spartacus UI ComponentDataProvider defer 工厂函数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 国标 计算机机房,国标相关知识:电子信息
- 下一篇: SAP 电商云 Spartacus UI