Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

135
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!