Live rendering

Direct
Data only
Data and Monitor Info
HOC
Composition
Last updated
Was this helpful?

Last updated
Was this helpful?
Was this helpful?
{counterState$.connectLive(data => (<h1>{data.counter}</h1>))}
import {counterState$} from "../../state/counter.state$";
<button onClick={counterState$.do.increment}>Increment!</button>
<button onClick={counterState$.do.decrement}>Decrement!</button>
{counterState$.connectLive(data=>(<div>
<h1>{data.counter}</h1>
</div>
))}
{
counterState$
.tuple(counterState$.asyncState)
.connectLive((data, monitorInfo) =>
(<h1>{data.counter} - {monitorInfo.status}</h1>)
)
}
import {ContextStateLive, StateLive} from "conan-js-core";
import { counterState$ } from "../../state/counter.state$";
<StateLive from={counterState$} renderer={(data, actions) => (<div>
<button onClick={actions.increment}>Increment!</button>
<button onClick={actions.decrement}>Decrement!</button>
</div>)}/>;
};
<ContextStateLive renderer={data => (<h1>{data.counter}</h1>)}/>
import {ContextStateLive, StateLive} from "conan-js-core";
import {CounterActions, CounterData, counterState$} from "../../state/counter.state$";
<StateLive<CounterData, CounterActions>
from={counterState$}
renderer={(data, actions)=>(
<div>
<button onClick={actions.increment}>Increment!</button>
<button onClick={actions.decrement}>Decrement!</button>
<CounterDisplay/>
</div>
)}
/>
<ContextStateLive <CounterData>
renderer={data => (
<h1>{data.counter}</h1>
)}
/>
import {contextStateLive, stateLive} from "conan-js-core";
import { counterState$ } from "../../state/counter.state$";
stateLive(counterState$, (data, actions) => (<div>
<button onClick={actions.increment}>Increment!</button>
<button onClick={actions.decrement}>Decrement!</button>
<CounterDisplay />
</div>));
contextStateLive(data => (<h1>{data.counter}</h1>))import {contextStateLive, stateLive} from "conan-js-core";
import {CounterActions, CounterData, counterState$} from "../../state/counter.state$";
stateLive<CounterData, CounterActions>(
counterState$,
(data, actions) => (
<div>
<button onClick={actions.increment}>Increment!</button>
<button onClick={actions.decrement}>Decrement!</button>
<CounterDisplay/>
</div>
)
)
contextStateLive<CounterData>( data => (
<h1>{data.counter}</h1>
));