Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

276
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda