dispatch a createAsyncThunk when a reducer si called #1765
-
Hello, export const getFeedbacks = createAsyncThunk('feedbacks/get', async (arg, { getState }) => { const feedbacksSlice = createSlice({ so when the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 17 replies
-
No, you can never make any kind of additional call like that in a reducer. However, you could try using the new experimental "action listener middleware" we're looking to add to RTK, currently available as a standalone package: |
Beta Was this translation helpful? Give feedback.
-
@markerikson I'm trying to use it but I have this error:
I have make the simpler inclusion:
what am I doing wrong? |
Beta Was this translation helpful? Give feedback.
No, you can never make any kind of additional call like that in a reducer.
However, you could try using the new experimental "action listener middleware" we're looking to add to RTK, currently available as a standalone package:
#1648