@ormojo/react-observe v1.0.1
@ormojo/react-observe
React components that re-render in response to Observables emitting values.
Components
Props:
source- an ES7 Observablechildren- a render prop whose first parameter will be the most recent emitted value.pure- Boolean, if true, renders only when thesourcechanges or emits a value. Don't usepureif your render prop is a function of props from the enclosing scope!
<Observe source={myObservable}>{(value) ->
<div>{value}</div>
}</Observe>Props:
children- a render prop whose first parameter will be the most recent emitted value.pure- Boolean, if true, renders only when thesourcechanges or emits a value. Don't usepureif your render prop is a function of props from the enclosing scope!All other props are expected to be ES7 Observables, which will be mapped in a key-value fashion using
combineLatestand the latest values will be passed to the render prop.
<ObserveMany val1={observable1} val2={observable2}>{({val1, val2}) ->
<div>{val1} {val2}</div>
}</Observe>