kefir-react
v5.0.0-rc.2
Published
React wrapper class for linking Kefir.js observables as props value
Downloads
15
Readme
kefir-react
React wrapper component for linking Kefir.js observables as props value
Usage example
import { KefirReact } from 'kefir-react';
const myProperty = Kefir.fromPoll(1, () => new Date()})
.toProperty(() => new Date());
class App extends React.Component {
render() {
return this.props.myValue;
}
}
const AppWrapped = KefirReact(
myProperty.map(myValue => { myValue }),
App
);
class Main extends React.Component {
render() {
return React.createElement(AppWrapped);
}
}API
Exports KefirReact factory and KefirReactComponent react component
KefirReact
(props$, ComponentClass, [LoaderComponentClass]) -> WrappedComponentClassSo in props of instantiated ComponentClass there will be values from props$
LoaderComponentClass is optional.
It'll be displayed until first value in props$.
Use kefir-combine-object to create props$
