12

Since subjective answers are to be avoided on SO, I'm specifically asking: What are the functional and/or performance differences between these three functional/reactive libraries that would make me choose one of them over the others? I have eliminated BaconJS because of its dependency on jQuery. I'm new to the JS streams, and primarily interested in starting to familiarize myself with them first in NodeJS, and later in AngularJS context. If you have selected one of these over the others, what criteria lead to the choice?

Ville
  • 4,088
  • 2
  • 37
  • 38

2 Answers2

18

Everything below is pretty subjective:)

RxJS

Pros:

  • Documentation and big community.
  • Shared interface with Rx* family. It's a big advantage because you can adopt samples from RxJava community.
  • A lot of primitives in the library and some samples how to use them
  • back-pressure
  • it is a kind of etalon for other libraries

Cons:

  • Sometimes it looks overcomplicated
  • Implemented with "Java" in mind

Bacon.js

Pros

  • Really nice documentation with some advanced samples(snake game, implementation for example)
  • a lot of primitives
  • Implemented with JS in mind
  • I found it really easy to start

Cons - it doesn't implement back-pressure which makes it silly on backend

Highland.js

Pros:

  • it's intended to work with node.js(or browserify) environment which is really nice
  • no alien concepts(from JavaScript/Node perspective)
  • back-pressure
  • the implementation is on top of Node streams which is really great idea
  • small footprint

Cons:

  • Silly documentation and no examples. Actually every time I'm trying to adopt samples from Rx or Bacon
  • absence of some primitives. Actually you can implement most of them by yourself already implemented but it's painful(see previous point)

Summary: because absence of samples you will learn them all:) IMHO, the most perspective one is Highland.js. But RxJs is much more mature

Tip: If you need to ask something on StackOverflow use RxJS dialect and translate it to youth

kharandziuk
  • 12,020
  • 17
  • 63
  • 121
  • Thanks for the answer.. this is very much what I was looking for ("pros/cons"). Highland.js looks perhaps the most attractive based on what you wrote above. However, as I'm exploring React, [a sample exists to use RxJS for the data flow instead of Flux](http://qiita.com/kimagure/items/22cf4bb2a967fcba376e). There's also [Rx bindings for React](https://github.com/fdecampredon/rx-react), and [an example for combining React, RxJS, React-router, and Webpack](https://github.com/Cmdv/React-RxJS). So you're right, I'll likely end up learning more than one of them. :) – Ville Nov 26 '15 at 03:01
5

The Reactive-Extensions repository has pages comparing these (each of the other ones to RxJS, naturally).

Bacon.js (and kefir.js as well)

Highland.js

Mosho
  • 7,099
  • 3
  • 34
  • 51
  • Thanks for pointing those out; I'll read through them. I keep this question open still for a while in case someone has done an in-depth comparison between them. – Ville Oct 18 '15 at 01:38