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

223
Views
Using redux and redux toolkit at same time

I just got new project where mostly it uses Redux, i changed my store to use 'configureStore' which comes from redux toolkit and everything works fine, but my reducers and actions are so large that i dont have time to convert those to use 'createslice', my question is in my reducers.ts file where i have all those 'switch' 'cases' can i use 'createslice' also there ? so i want to continue the project with 'createslice' and not convert those older codes to 'createslice' ? is it ok ?

English is not my mother language so could be mistakes.

Example code:

export function articleReducer(
  state = initialState,
  action: articleReducerAction
) {
 switch (action.type) {
    case ActionType.GET_A:
      return {
        ...state,
        books: action.payload,
      };
    case ActionType.GET_B:
      return {
        ...state,
        libraries: action.payload,
      };
      
       }
}

export const articleReducerr= createSlice({
  name: "app",
  initialState: {
    books: [],
    libraries: [],
  },
  reducers: {
    GET_C: (state, action) => {
      state.books = action.payload;
    },
    GET_D: (state, action) => {
      state.libraries = action.payload;
    },
 },
});

export const { GET_C, GET_D, } =
articleReducerr.actions;

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Yes, you can incrementally convert a project to Redux Toolkit one reducer or one function at a time, and it will all continue to work together. See https://redux.js.org/tutorials/fundamentals/part-8-modern-redux for an example.

(In fact, I work for https://replay.io , and our codebase at https://github.com/RecordReplay/devtools is absolutely a mixture of "modern" and "legacy" Redux patterns!)

That said, I'd definitely recommend trying to migrate more code to createSlice whenever possible.

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!