Skip to content

Instantly share code, notes, and snippets.

View hebuliang's full-sized avatar

He Liang hebuliang

View GitHub Profile
@hebuliang
hebuliang / render-react-with-rxjs.md
Created December 1, 2016 06:41 — forked from zxbodya/render-react-with-rxjs.md
React with RxJS, reactive way :)

Observable React elements with RxJS

Note: if you want to skip history behind this, and just looking for final result see: rx-react-container

When I just started using RxJS with React, I was subscribing to observables in componentDidMount and disposing subscriptions at componentWillUnmount.

But, soon I realised that it is not fun to do all that subscriptions(that are just updating property in component state) manually, and written mixin for this...

Later I have rewritten it as "high order component" and added possibility to pass also obsarvers that will receive events from component.