Skip to content

Commit cad9cb9

Browse files
committed
fix docs
1 parent ad94c66 commit cad9cb9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/api/createSlice.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,11 @@ Alternatively, the `reducers` field can be a callback which receives a "create"
141141
The main benefit of this is that you can create [async thunks](./createAsyncThunk) as part of your slice (though for bundle size reasons, you [need a bit of setup for this](#createasyncthunk)). Types are also slightly simplified for prepared reducers.
142142

143143
```ts title="Creator callback for reducers"
144-
import { createSlice, nanoid } from '@reduxjs/toolkit'
144+
import { buildCreateSlice, asyncThunkCreator, nanoid } from '@reduxjs/toolkit'
145+
146+
const createSlice = buildCreateSlice({
147+
creators: { asyncThunk: asyncThunkCreator },
148+
})
145149
146150
interface Item {
147151
id: string

0 commit comments

Comments
 (0)