I am trying to use forkJoin to run an array of objects with a key and a value which is the observable. I need to make it to where the array of objects will result in the key being the same and the value being the result of the observable api call. This object can have any number of key value pairs. And I need to wait till they are all done before I can continue.
If I have:
{
headerLogo: this.http.post(url, image),
loginBackground: this.http.post(url2, image)
}
I need it to result in:
{
headerLogo: resultOfApiCall
loginBackgroud: resultOfApiCall2
}
I have tried using ForkJoin but it seems to only take an array of just the observables and no keys. They keys are important so that I know what URL goes with what key so I can save them in the correct spot. The original fork join will return an array of objects which represent the result of the api calls but I have no idea which one belongs to which key.
Any thoughts on this?