'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?
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | enno.void |
