A simple and convenient function that resolves promises in data structures like arrays, objects, Maps, and Sets
What is mux?
Mux is a function that multiplexes promises in nested data structures and resolves them like this:
await;// Result:a: result1b: result2
yarn add @exponent/mux
And import it like this:
You can also pass in deeply nested data structures like this:
await;// Result:a:b: result1
And if your promises themselves result in data structures, mux will recurse into them and resolve the nested promises.
await;// Result:a: result1
Check out the test suite for even more examples.