Connecting
Direct
import { counterState$ } from "../../../state/counter.state$";
{counterState$.connect(CounterDisplay)}import { counterState$ } from "../../../state/counter.state$";
counterState$.connectMap(CounterContainer, (data, actions) => ({
decrementCounter: actions.decrement,
incrementCounter: actions.increment
}));
counterState$.connectMap(CounterDisplay, data => ({
counter: data.counter
}))
import {counterState$} from "../../../state/counter.state$";
counterState$.connectMap<CounterContainerProps> (
CounterContainer,
(data, actions)=>({
decrementCounter: actions.decrement,
incrementCounter: actions.increment
})
)
counterState$.connectMap<CounterDisplayProps> (
CounterDisplay,
data=>({
counter: data.counter
})
)HOC
Composition
Hooks
Last updated
Was this helpful?