use truely functional pipeline #6266
Replies: 3 comments 4 replies
-
As far as I understood, this should work out-of-the-box with the current system. What prevents you from doing the following?: import { from } from 'rxjs';
import { map, filter, reduce } from 'rxjs/operators';
const languages = from(array)
|> filter(value => {
const bg = value.experience.toLowerCase();
return bg.includes('javascript') || bg.includes('c++');
})
|> reduce((acc, obj) => {
acc.push(obj.name);
return acc;
}, [])
languages.subscribe(console.log); I haven't tried, but as far as I can tell you don't need to suffix every function name with something so it can be piped, nor change the import path 🤔 BTW there's an issue that's already proposing moving all exports to the root |
Beta Was this translation helpful? Give feedback.
-
your transpile result is all right! With the popularity of functional programming, there may be many functions with similar names, If there is no name conflict, the complex name space |
Beta Was this translation helpful? Give feedback.
-
First, as shared there is #6367 to improve ergonomics. Secondly, I do not believe core team will pursue renaming all api surfaces to distinguish rxjs's api surface to other functional libraries. Separately, there are individual api surface level discussions to improve naming and it is current goal for immediate roadmaps for core team for viable future. |
Beta Was this translation helpful? Give feedback.
-
It is recommended to put the operator function in
rxjs/operators
with a suffixObservable
and move up to the root spacerxjs
.This enables a truely functional pipeline operation stream.
Beta Was this translation helpful? Give feedback.
All reactions