11---
22name : data-client-react
3- description : Use @data-client/react hooks - useSuspense, useQuery, useCache, useLive, useDLE, useSubscription, useController for fetch/mutations, DataProvider, AsyncBoundary, useLoading, useDebounce
3+ description : Use @data-client/react hooks - useSuspense, useFetch, useQuery, useCache, useLive, useDLE, useSubscription, useController for fetch/mutations, DataProvider, AsyncBoundary, useLoading, useDebounce
44license : Apache 2.0
55---
66## Rendering
@@ -19,6 +19,9 @@ const todo = useCache(TodoResource.get, { id: 5 });
1919const todo = useQuery (Todo , { id: 5 });
2020// fetch without Suspense - returns { data, loading, error }
2121const { data, loading, error } = useDLE (TodoResource .get , { id: 5 });
22+ // suspense in parallel
23+ const post = use (useFetch (PostResource .get , { id }));
24+ const comments = use (useFetch (CommentResource .getList , { postId: id }));
2225// subscribe without Suspense (use with useSuspense or useDLE)
2326useSubscription (TodoResource .get , { id: 5 });
2427```
@@ -125,6 +128,7 @@ This is useful for webosckets, SSE, logging, etc. Always use the skill "data-cli
125128For detailed API documentation, see the [ references] ( references/ ) directory:
126129
127130- [ useSuspense] ( references/useSuspense.md ) ;[ _ pagination.mdx] ( references/_pagination.mdx ) - Fetch with Suspense
131+ - [ useFetch] ( references/useFetch.md ) - Fetch for React.use() and parallel loading
128132- [ useQuery] ( references/useQuery.md ) - Read from cache without fetch
129133- [ useCache] ( references/useCache.md ) - Read from cache (nullable)
130134- [ useLive] ( references/useLive.md ) ;[ _ useLive.mdx] ( references/_useLive.mdx ) - Fetch + subscribe to updates
0 commit comments