Skip to main content

waitForAny(dependencies)

A concurrency helper that returns a set of Loadables for the current state of the requested dependencies. It waits until at least one of the dependencies are 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.