What is the intended way of importing lettable operators?
See original GitHub issueRxJS version: 5.5
I’ve been using lettable operators since 5.5 was in beta, it was great. But I have a few concerns regarding the way to import them.
Are we supposed to do this:
import { map } from 'rxjs/operators';
or:
import { map } from 'rxjs/operators/map';
Either way, it works the same. But for the sake of consistency, shouldn’t there be only one way of doing this?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:27 (6 by maintainers)
Top Results From Across the Web
RxJS: Understanding Lettable Operators - ncjamieson
As with the call -based approach, lettable operators are imported explicitly. They can be imported from the operators directory (note the plural) ...
Read more >Lettable operators in RxJs - The art of simplicity
A lettable operator is basically any function that returns a function ... import { range } from 'rxjs/observable/range'; ... All method:.
Read more >Importing only desired features from rxjs in angular 2 component
Usually one will group them inside one single file per application and import only Observable in the places where it's neded. In the...
Read more >angular/angular - Gitter
U have static operators and prototype operators (prior to rxjs 5.5) ... I imported everything with the lettable method, so the static Observable.merge() ......
Read more >[TypeScript] RxJS lettable operator - type inference support
WEB-29555 RxJS lettable operators in TypeScript: no method suggestions ... from 'rxjs/Observable'; import {switchMap, map} from 'rxjs/operators'; ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m really hoping we see a future version where we can import most or all of the RxJS stuff from a single place. Here is an example I have in a simple use of RxJS right now:
This is rather tedious, of the 5 things I want, all 5 have to come from a different module.
I’d like to write something more like:
Of course I could accomplish this myself with some kind of wrapper, but I would like something close to this to become idiomatic, documented official usage. A man can dream?
The intended way to import lettable/pipeable operators in 5.5 is:
Sorry it took so long for me to respond. 👍