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

362
Visualizações
How to avoid calling StoreModule.forRoot() twice when using ngrx in a library

I am creating an angular library that uses ngrx. For the library I have just a couple Feature reducers that I can initialize easy enough in the library base module. The problem is that I don't know whether or not to call StoreModule.forRoot(...) in the library base module. Some consumers of the library already use ngrx so if I do it will break as it gets called twice however some consumers are not using it so it will break if I don't include it. I could require all consumers who do not already use ngrx to include StoreModule.forRoot([]) in their base module imports but I would like to avoid this. Is there a way to conditionally initialize the store module from the library to avoid these errors?

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