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

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

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

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 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