Hacker News new | ask | show | jobs
by sinkasapa 4789 days ago
Other than the fact that this is more minimal, does anyone have any insight in to how this compares to Bacon, Flapjax or RxJs? I've been wanting to give this coding style a try but tend to get turned off by the size and complexity of the existing libraries. I look at this as a personal fault not that of the libraries. I plan to read the source of Reactor.js, which is very well commented. Until then, does anyone know if this is a "complete" implementation or is something fundamental missing? Is it push or pull?
3 comments

Bacon/Rx allows you to work with an event stream abstraction, which assigns responsibility quite differently.

Bacon is more like excel in the sense that a cell defines /itself/ in terms of other cells

    A1 = B1 + C1
or in Bacon

    var as = bs.combine(cs, (b,c) -> b + c)
The style in ko/reactor is often inverted. One opens a 'bus' or 'signal', to which an arbitrary set of others push values.

    var as = Signal()

    function bs() {
      as(...) // push value
    }
Of course, the point of Bacon is that Rx.js does not quite define an event stream abstraction, as it has the (kinda weird) distinction between hot and cold observables which can be way surprising.
Knockout does this but it also has declarative html bindings, so there is no need to do the observer logic, you just add some lightweight annotations to your html and it binds for you. I think this is a lightweight alternative to ko, but ko does a lot more and is very easy to use.
But I only want the reactive programming part. How do I take out all the parts that I don't want or need in knockout?
It's "complete" as far as I've tested it. Changes are automatically pushed out without any additional work.

In terms of how it compares - It's based off the same reactive programming principles but is trying to keep the additional syntax and complexity to a minimum.

It looks just perfect for me. And to those who keep on talking about knockout.js, this is great because not everyone wants all the bloat of yet another big "do everything" JS library.