Combining Asynchronous Effects in React

Hey, I'm trying to figure out the best way of combining two different asynchronous Effects in a React application such that when both are unfinished the combined Effect returns an object lke { a: undefined, b: undefined }, when one of them finishes their key gets their value, and when the other finishes both keys have the value. I'm currently manually coordinating this by having two SubscriptionRefs, and combining the Streams with Stream.zip and consuming that in a react hook. Using streams because the values can change over time based on input, without that I would just use Refs. Just checking in to see if people have better or different ideas about how to achieve this?
Was this page helpful?