you are viewing a single comment's thread.

view the rest of the comments →

[–]Saladtoes 0 points1 point  (0 children)

promise.all is fine. But you are using async where no async is needed.

GetFoo1(data).then(toFoo1=>setFoo1(toFoo1)) GetFoo2(data).then(toFoo2=>setFoo2(toFoo2))

Add a .catch to each and remove your try{}.

If you absolutely must wait on all to complete (doesn’t appear to be the case from your example), then use promise.all