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

145
Vistas
What's the difference between 'rxjs/operators' and 'rxjs/internal/operators'?

In an Angular project, when I try to import things like Observable, or in this case, the switchMap operator, I have two options:

import { switchMap } from 'rxjs/operators';

or

import { switchMap } from 'rxjs/internal/operators';

What's the difference?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

There is no difference.

import { switchMap } from 'rxjs/operators';

Is also loaded from the internal location, see operators/index.ts

I would suggest using the first one, if the rxjs maintainers change the internal project structure, it won't break your imports.

about 4 years ago · Juan Pablo Isaza Denunciar

0

As of RxJS v7.2.0 it's adviced to import directly from 'rxjs':

import { switchMap } from 'rxjs';

As mentioned on the RxJS website:

With RxJS v7.2.0, most operators have been moved to 'rxjs' export site. This means that the preferred way to import operators is from 'rxjs', while 'rxjs/operators' export site has been deprecated.

Although the old way of importing operators is still active, it will be removed in one of the next major versions.

about 4 years ago · Juan Pablo Isaza Denunciar
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