
Security News
PyPI Expands Trusted Publishing to GitLab Self-Managed as Adoption Passes 25 Percent
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads
Creates a promise that waits for the promises in nested data structures and resolves to data structures of the same form. It recursively traverses the input data structure and multiplexes its promises.
A simple and convenient function that resolves promises in data structures like arrays, objects, Maps, and Sets
Mux is a function that multiplexes promises in nested data structures and resolves them like this:
await mux({
a: asyncFunction1(),
b: asyncFunction2(),
});
// Result:
{
a: result1,
b: result2,
}
yarn add @expo/mux
And import it like this:
import mux from '@expo/mux';
You can also pass in deeply nested data structures like this:
await mux({
a: {
b: asyncFunction1(),
},
});
// Result:
{
a: {
b: result1,
},
}
Mux supports several standard JavaScript data structures:
await mux(new Set([
asyncFunction1(),
asyncFunction2(),
]));
// Result:
new Set([
result1,
result2,
])
And if your promises themselves result in data structures, mux will recurse into them and resolve the nested promises.
await mux([
Promise.resolve({
a: asyncFunction1(),
}),
]);
// Result:
[
{
a: result1,
},
]
Check out the test suite for even more examples.
If you've discovered a particularly interesting way to use mux, add it here and send a PR to share it.
FAQs
Creates a promise that waits for the promises in nested data structures and resolves to data structures of the same form. It recursively traverses the input data structure and multiplexes its promises.
The npm package @expo/mux receives a total of 7,463 weekly downloads. As such, @expo/mux popularity was classified as popular.
We found that @expo/mux demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.