Skip to content

Commit 7ebe125

Browse files
committed
docs(rtk-query): Clarify standard slice exports
The existing documentation implies that standard slices *only* export action creators and reducers. This can create confusion when users compare this with fuller implementations within the codebase, such as the `postsSlice.ts` example shown earlier in Part 6. That file demonstrates that robust slices require exporting additional items like async thunks, types, selectors, and listener middleware. This change updates the wording to clarify that the original statement refers to the *minimal* exports needed from `createSlice`, providing better and unambiguous context before contrasting with `createApi` exports.
1 parent c303b1f commit 7ebe125

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/tutorials/essentials/part-7-rtk-query-basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ For TypeScript usage, **the `builder.query()` and `builder.mutation()` endpoint
216216

217217
#### Exporting API Slices and Hooks
218218

219-
In our earlier slice files, we just exported the action creators and the slice reducers, because those are all that's needed in other files. With RTK Query, we typically export the entire "API slice" object itself, because it has several fields that may be useful.
219+
From our earlier `createSlice` functions, we only needed to export just the action creators and the slice reducers, because those are the only part of the slice functions that are needed in other files. With RTK Query, we typically export the entire "API slice" object itself, because it has several fields that may be useful.
220220

221221
Finally, look carefully at the last line of this file. Where's this `useGetPostsQuery` value coming from?
222222

0 commit comments

Comments
 (0)