Skip to content

Commit 38825b9

Browse files
authored
Include Post interface to fix compilation error
1 parent 5c519f7 commit 38825b9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

docs/rtk-query/usage/pagination.mdx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,15 @@ const PostList = () => {
8080

8181
If you have caching enabled for your paginated queries, it maybe a good idea to invalidate the `LIST` cache as well when you do a `delete` mutation.
8282

83-
```ts title="src/features/services/post.ts
84-
// Or from '@reduxjs/toolkit/query' if not using the auto-generated hooks
83+
```ts title="Example of invalidating cache for paginated queries"
84+
// file: types.ts noEmit
85+
export interface Post {
86+
id: number
87+
name: string
88+
}
89+
90+
// file: api.ts
91+
// Or from '@reduxjs/toolkit/query/react'
8592
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'
8693
import { Post } from './types'
8794

0 commit comments

Comments
 (0)