I have built an Angular(14) app where I need to store some data in a DB. So I have a component with a button, I want to press this button and do stuff in three different components, when they are all done I want to send the data to the backend.
I tried to have three subject where each child passed along the data but that did not work since I do not know what of the three children that will be done first. I think it will work if I let the button trigger child 1 that trigger child 2 that trigger child 3 and then from child three trigger the menthod that will send the data to backend. But that will be ugly.
I did managed to make it work with emits from each child but they are very nested so I did not like the solution.
I have tried to use the async/await but can't find any sugestions on google with this senario, all the await/async seams to be used when the http request will be used.
I would really like the async/await method to work. Do any of you have a nice and clean suggestion or do you have a example where async/await is not used with the http request?