question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does xstream have a similar concept to rx's pipeable operators?

See original GitHub issue

https://github.com/ReactiveX/rxjs/blob/master/doc/pipeable-operators.md

I’m a huge fan of FP with pipe and compose (ramda, lodash/fp), so I like that rx has a pipe fn. I also like xstream’s simplicity. Curious if xstream enables piping of some sort, sans the dot. Fns like .map and .filter make me a bit apprehensive. Patching prototypes for custom fns can get tricky, especially if the chaining hides internal mutation.

Compose seems like it might be similar to source$.pipe(fns...) in the rx link. Is it? And, if so, how easy would it be to reverse it for pipe’s redability? e.g., const pipe = (...fns)=>compose(...fns.reverse());.

Related: This mention of pipe-style api seems like it might reference the same concept, but is the only issue with the word “pipe” in it.

Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
anilanarcommented, May 23, 2018
1reaction
Widdershincommented, Apr 24, 2018

Does that make sense? To summarize, more complex operators can be implemented as one-liners by applying regular pipe/compose functions to the existing set of operators (each written as fn=>stream=>stream.foo(fn)). No need to patch the prototype, or manually create producer+listener objects, unless doing something that isn’t composable from existing operators or for performance. If that’s correct, cool!

That is indeed correct 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular RxJS In-Depth
Finally we'll see how to use some popular pipeable operators such as tap() , map() and filter() and their new import paths in...
Read more >
RxJS Operators
Operators are functions. There are two kinds of operators: Pipeable Operators are the kind that can be piped to Observables using the syntax...
Read more >
monojack/xsrx: Pipeable operators for xstream, with rxjs ...
Reason: Being an avid rxjs user I want to be able to use xstream's hot streams without having to "switch" to a different...
Read more >
Do RxJS operators use .subscribe() under the hood?
The short answer is yes. I've elaborated a bit on it in this answer. From my perspective, the magic of RxJS is achieved...
Read more >
10. Understanding RxJS Operators. Two kinds of ... - YouTube
In this video, we will see the introduction of RxJS Operators and how ... Two kinds of operators like Pipeable & Creation Operators...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found