const KefirReact = (observable, Component) => {
return props => h(KefirReactComponent, {
observable,
render: values => h(Component, merge(props, values))
});
}
class Test extends React.Component {
render() {
return h(KefirReact(stream, MyComponent));
}
}
const Test = KefirReact(stream, MyComponent);
ReactDOM.render(
h(KefirReact(stream, MyComponent)),
$('#app')
);
And export both KefirReact and KefirReactComponent. The second can be used when observable depends on props.
But there is a problem with observable - it should be KefirObservable<props>, and in most cases it will be combined object of Observables. But it still not implemented in Kefir: https://github.com/rpominov/kefir/issues/143
And export both
KefirReactandKefirReactComponent. The second can be used whenobservabledepends onprops.But there is a problem with
observable- it should beKefirObservable<props>, and in most cases it will becombined object of Observables. But it still not implemented in Kefir: https://github.com/rpominov/kefir/issues/143