DEV Community

Discussion on: Angular - Zoned Out !

Collapse
 
jwp profile image
John Peters

If the client is firing the async requests they can track the response right? Be it just one or hundreds all promises can be combined and monitored for completion. As each one completes a message is sent to the tracker. Only 2 things are known, the promise and the resolve.

Thread Thread
 
suvi profile image
Suvendu Karmakar • Edited

That's just one extra line of code inside each subscribe or then (100 repetitive lines of code for 100 responses , and I haven't even counted calls which are merged into one observable, what if I want to track each one seperately, like I want to show a different message for each call ), defeats the purpose of the whole post. Sorry but I don't see a solution here .

Thread Thread
 
jwp profile image
John Peters

All work can be refactored ro just one function which sends the request, subscribes and posts a completion message.