Suppose that a is fetched through api y and b is fetched through api z. Both y and z are called once and only once, when a component is mounted. After fetching a and b, I need to reassign a to be g(a,b) where g is some function.
What's the best way to perform this?
I can think of one way: Should I fetch b first and then, when the promise encapsulating b resolves, fetch a. Then, when the promise encapsulating a resolves, reassign a to be some function of a and b. Or I could use Promise.all
PS: More generally, I also need to fetch c through api omega. I need to reassign c to h(g(a,b), c).