SAP Spartacus CmsComponentConnector

This code is more complicated. Analyze one by one:

this.cmsStructureConfigService.getComponentsFromConfig(ids):

Implementation of this.getComponentById:
Return from memory:

Then encapsulate it into Observable through of.
This Observable then calls pipe to assemble a switchMap function.


Function implementation of switchMap: Check if there is a Component that is not loaded from the configuration. If not, use Observable to wrap the Component in the memory; if there is, enter the IF branch on line 49 to get it:

To get more original articles by Jerry, please follow the public account "Wang Zixi":

Guess you like

Origin blog.csdn.net/i042416/article/details/108603346