Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

363
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda