I have a data store implementation that is shared among a lot of instances of the same component. I am subscribing to the observable of the store's datasource
which is a behavior subject at all of these different component instances. I am passing data to store several times and the store notifies it using .next() in the datasource
. But sometimes all these subscriptions are executed, sometimes only the last few are executed. I get no errors in the console as well. Any thoughts?
UPDATE: My application heavily uses create embedded views and dynamic module injection. So I found out that there is a delta time to get any reference for the embedded view. Which is why we use ngAfterViewInit in case of embedded views. Hence, the child components had not yet subscribed to the data stream and I had already sent data fram the parent components. But since I have multiple instances of the same component I do not want n callbacks for n ngAfterViewInit.
Closing this issue. Since, this is an issue/bug in my proprietary app architecture.