A suspenseful hook that returns, and caches, the results of calling one or more async functions, typically to load data from a third-party via server functions.
<React.Suspense/>
component
and give it a fallback
component to render until the functions have completed.string
key to an async function. If the function requires parameters,
the key should map to an array with the async function as the first element and the parameters as
the subsequent elements.
values
: an object mapping from the string
keys provided to whatever type that key’s async
function returnsinvalidate
: a (key: string) => void
function to call to invalidate individual cached
values, called with the key you want to invalidateinvalidate()
will cause the values for the specified function to be fetched again,
re-suspending the component.