npm install --save react-xstream-hoc
A utility function (higher-order component, 'HOC') that takes a React component as input, and returns a React component that behaves like the input but knows how to listen to xstream streams from props.
Let's say you have a normal React component that accepts normal props:
<MyComponent isBlue={true} />
But you want the component to accept isBlue
as an xstream stream, and have that component automatically listen to the stream and update accordingly.
import {withXstreamProps} from 'react-xstream-hoc';
const MyXSComponent = withXstreamProps(MyComponent, 'isBlue');
// ... then in a render function ...
<MyXSComponent isBlue={obs} />