-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suspense API #11
Labels
Comments
@azmenak I gave this some thought last night and used Using a cached API response: const [users] = useApiData(UserEndpoints.list()) This hook would read the data from the cache directly, and does one of the following:
Other things to consider:
Pre-fetching data imperatively: const prefetch = useApiPrefetcher()
return (
<button type='button' onClick={() => {
prefetch(UserEndpoints.list())
}}>
Load user
</button>
)
Pre-fetching data as it renders (ie useApiPrefetch(UserEndpoints.list())
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since this data-fetching library has a built-in cache, we are well-positioned to implement a suspense API in addition to the
useApiQuery
state-based API.The API should support both "fetch as you render" and "fetch before render".
The text was updated successfully, but these errors were encountered: