Skip to content

Commit 9cef711

Browse files
authored
Fix bug in docs for createAsyncThunk example
fetchUserById payloadCreator should fetch when in pending (not idle) state
1 parent 36b25fc commit 9cef711

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/api/createAsyncThunk.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ const fetchUserById = createAsyncThunk(
327327
'users/fetchByIdStatus',
328328
async (userId, { getState }) => {
329329
const { loading } = getState().users
330-
if (loading !== 'idle') {
330+
if (loading !== 'pending') {
331331
return
332332
}
333333
const response = await userAPI.fetchById(userId)

0 commit comments

Comments
 (0)