Hey, thanks for the share. Where I haven't used Rx per se, I used Bacon extensively at my last gig.
Rx is a module, and you're merging `plus$` and `minus$` to 'Rx.Observable' - is there an issue of having these bindings persist when the React component unmounts? What would be the best practice for tidying up in `componentWillUnmount`?
Calling `subscribe` on an observable returns a subscription that can be disposed at a later time. The approach that I use is something like this: http://jsbin.com/seyetudasu/edit?js
If you are subscribing to multiple observables in a single component, you could also consider using `CompositeDisposable`, which allows you to merge multiple subscriptions into a single disposable.
Cool, thanks for the clarification.
I guess I should read a bit of the Rx API docs, but doesn't seem far off Bacon with `combineTemplate`; which from memory returns a curried function to end any streams. Someone correct me if I'm wrong.
There very much is - without having dug deeper, this doesn't look like a complete answer, but merely serves as an introduction on how to begin using it.
You should definately unregister your event listeners in componentWillUnmount. If you wanted to pursue this approach I would probably make a higher level component (or mixin) to declaretively and automatically handle the binding and unbinding of events, plus the glue to rxObservables.
RxJS provides this consideration with dispose() for many ephemeral Observables. Keep track of your subscriptions and dispose in `componentWillUnmount`.
e: better data above.