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

270
Views
How to remove a slice / reducer in a redux store?

In the register component of my APP, the state is stored in a redux slice. After the user registers, this component will never be rendered again and thus the memory in its redux slice should be freed up for performance.

How can this be done?

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

The performance gain from freeing up a tiny bit of memory is negligible if even measurable, don't bother.

about 4 years ago · Santiago Trujillo Report

0

Can I dynamically add / remove slice of the state ?

Yes you can remove / add dynamically a slice of the state with redux, this is usually done for code splitting reasons

How to do it ?

You can follow this steps to achieve it: https://redux.js.org/usage/code-splitting

Note

I agree with @timotgl note, based on what you have in this slice this is negligible

about 4 years ago · Santiago Trujillo Report

0

Redux is generally used for global state. What you are describing is local state, and should probably be moved out of redux, and into local component state. You could keep your reducer, actions, and selectors, and just refactor them into a call to React.useReducer instead of redux.

about 4 years ago · Santiago Trujillo 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!