控制SAP Spartacus shipping address页面spinner显示的逻辑
直接查看页面源文件shipping-address.component.html:
为简单起见,本文只讨论isLoading$这个参数:类型为boolean的Observable对象
UserAddressService才知道Address的加载进度:
UserAddress又依赖于Store和AuthService:
getAddressesLoading的实现:
再看UsersSelectors.getAddressesLoading:
如果shipping address数据仍然在读取过程中,isLoading$.subscribe返回true,则显示spinner.
要获取更多Jerry的原创文章,请关注公众号"汪子熙":