Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
Redux-toolkit multiple AsyncThunk at one slice

What is the best approach to manage multiple AsyncThunk at single slice. Would be correct if I put computed properties of each async action?

export const register = createAsyncThunk('user/register', async (payload, { rejectWithValue }) => {

})

export const login = createAsyncThunk('user/login', async (payload, { rejectWithValue }) => {

})

export const userSlice = createSlice({
    name: "user",
    initialState: { currentUser: "", },
    extraReducers: {
        [register.pending]: (state) => {
        },
        [register.fulfilled]: (state) => {
        },
        [register.rejected]: (state) => {
        },

        [login.pending]: (state) => {
        },
        [login.fulfilled]: (state) => {
        },
        [login.rejected]: (state) => {
        },
    }
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Not sure if this is the answer you are looking for but it appears correct based on documentation: https://redux-toolkit.js.org/api/createreducer#usage-with-the-map-object-notation

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!