A rxjs observable -> render function component for React.
You can either install the module via
npm install @jnsdls/rx-react-render --save
yarn add @jnsdls/rx-react-render
I wanted a dead simple way to get rxjs observable values rendered. Existing solutions included all kinds of capabilities that I did not need. All I wanted is to pass an observable, and get its value as it changed over time passed through a render function.
RxReactRender makes no assumptions about how you create your observables or what data they contain. Instead it handles subscribtion & unsubscription and gives you the current values. That's it.
A very simple and minimal example of how to set up RxReactRender which takes an interval() observable and renders a span with the elapsed seconds inside.
Usage in combination with non-observable props
Here's a contrived but interactive example for how you could use this for an input
;;;;;const inputState$ = '';ReactDOM;
||A render function that will receive an object of values that map to the observables you passed|
||Any observable you pass will be subscribed to and the valye passed into the render function|
||Any non-observable props you pass will not be touched and simply forwarded into the render function|