Currently, I am engaged in a project for my organization and am strictly upholding the Non-Disclosure Agreement (NDA) that I have signed. In adherence to this confidentiality agreement, I present the following code snippet devoid of any sensitive details:
toggleLoadingAnimation()
Subscription1()
Subscription2()
…
Subscription10()
toggleLoadingAnimation()
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.10/angular.min.js"></script>
this.randomFieldSubscription = this.randomService.randomEntityList.value$.subscribe(entityList => {this.entityList = entityList})
Upon execution of .subscribe, a request is also sent to the server within the randomService.
I am grappling with how to ensure that the second toggleLoadingAnimation() is triggered only after completion of all preceding Subscriptions and once responses from the server are fully received.