SAP Spartacus reads the request sending and receiving source of User Address

First look at the receiving source of the request response:

文件:projects\core\src\user\store\effects\user-addresses.effect.ts

Receive UserActions.LOAD_USER_ADDRESSES sent by the application, after calling the connector to read the data, send a new Action: UserActions.LoadUserAddressesSuccess

UserActions.Load_USER_ADDRESSES is a string:

And UserActions.LoadUserAddressesSuccess is an Action class, which contains a type field: LOAD_USER_ADDRESSES_SUCCESS.

Because effect only passively receives the request and then loads the data, then who triggered the Load User Address request? Search by keywords:

No useful information was found. Because the action LoadUserAddresses defines the type of LOAD_USER_ADDRESSES, search for LoadUserAddresses:



Through runtime debugging, it can be found that the address data read request initiated in the shipping-address Component initialization hook ngOnInit:

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

Guess you like

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