Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipe operator #192

Open
c69 opened this issue Jul 23, 2018 · 3 comments
Open

pipe operator #192

c69 opened this issue Jul 23, 2018 · 3 comments

Comments

@c69
Copy link

c69 commented Jul 23, 2018

Currently this proposal only defines the basic observable, but as you all probably know - nobody uses RxJS/etc for observables alone. The whole point is operators.

Standardizing operators is as a cimmon wisdom probably too early, but there is one operator worth incuding in base spec. That is pipe - the composition operator and preferred way to use operators in RxJS 5.5+

'pipe' allows to write operators as simple functions and thus extend the library.

This was already mentioned few times in other issues, so just wanted to highlight it separately.

@benjamingr
Copy link

Basically: The idea isn't to replace libraries like rx and xstream, the idea is for the native DOM and other platforms like Node to be able to expose observables which said libraries can consume.

Even if the DOM did ship observables - I'm not sure why we'd want to add pipe - IIUC it was added due to code splitting and DCE concerns which are not concerns the language itself has

@c69
Copy link
Author

c69 commented Jul 23, 2018

to be able to expose observables which said libraries can consume

but what is the point of consuming Observable without operators ? 🤔

you need at least filter and map for even basic use cases, but as there are no operators included in this proposal at all - i was wondering how consumption will work ? with each library using their own implementation of from method ?

@dmitry-korolev
Copy link

dmitry-korolev commented Jul 23, 2018

Piping is essential, but it can be done with a vast set of tools, starting from const pipe = (...fns) => (val) => fns.reduce((p, f) => f(p), val) and ending with https://github.com/tc39/proposal-pipeline-operator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants