The waitFor function wraps a component. This component will be rendered only once all promises in the promises
iterable are resolved.
Options:
meanwhile
: A react node which will be rendered until promises are resolved.error
: A react ndoe to be renderd in case any of the promises are rejected.
This is my first attempt at a higher-order component, inspired by Dan Abramov's post.