waitForAny(dependencies)
A concurrency helper that returns a set of Loadable
s for the current state of the requested dependencies. It waits until at least one of the dependencies is available.
The dependencies may either be provided as a tuple array or as named dependencies in an object.
function waitForAny(dependencies: Array<RecoilValue<>>):
RecoilValueReadOnly<UnwrappedArrayOfLoadables>
function waitForAny(dependencies: {[string]: RecoilValue<>}):
RecoilValueReadOnly<UnwrappedObjectOfLoadables>
waitForAny()
is similar to waitForNone()
, except that it waits until at least one dependency has a value (or an error) available instead of returning immediately.