Sorry for the confusing title, it was hard wording it.
I have an angular service that calls an API and gets a list of pages. These pages are subscribed to from multiple components. With this in mind i use BehaviorSubjects to make sure each subscriber gets the updates.
When I want to add a new page, i need to submit a HTTP POST request to the server, and then handle the response. In handling it, i need to update the array and then call next() to send the updates around to the subscribers. This requires me to have a subscriber on the HTTP call (at least i think it does) so that i can call next(). However, at the same time as calling next, i also want the component to update and let the user know its been completed.
Here is a stackblitz example. app.component.ts line 38 has a call to the service to create a page. Commented out below, is a section of code that would subscribe and set the isSaving variable to false. however, i cannot subscribe to the method as it already has a subscription inside the pages.service.ts file.
https://stackblitz.com/edit/angular-abi4mn
I'm hoping the example makes more sense than my ramblings, apologies if the explanation is poor.