Skip to content

Commit c5067bf

Browse files
authored
Merge pull request #3766 from Azeirah/patch-1
2 parents 52ab548 + 0faafdb commit c5067bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/rtk-query/usage/usage-without-react-hooks.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Cache subscriptions are used to tell RTK Query that it needs to fetch data for a
2323
With React hooks, this behavior is instead handled within [`useQuery`](../api/created-api/hooks.mdx#usequery), [`useQuerySubscription`](../api/created-api/hooks.mdx#usequerysubscription), [`useLazyQuery`](../api/created-api/hooks.mdx#uselazyquery), and [`useLazyQuerySubscription`](../api/created-api/hooks.mdx#uselazyquerysubscription).
2424

2525
```ts title="Subscribing to cached data" no-transpile
26-
dispatch(api.endpoints.getPosts.initiate())
26+
// interact with the cache in the same way as you would with a useFetch...() hook
27+
const {data, refetch, isLoading, isSuccess, /*...*/} = dispatch(api.endpoints.getPosts.initiate())
2728
```
2829

2930
## Removing a subscription

0 commit comments

Comments
 (0)