Counter
can be even easier:var Counter = function(props) {
return (
<button onClick={actions.click}>
Click me! Number of clicks: {props.count}
</button>
);
};
theme.display = (m) => ReactDOM.render(
theme.counter(m.count, actions.click),
document.getElementById('container')
)
var Counter = function(props, action) {
return (
<button onClick={action}>
Click me! Number of clicks: {props.count}
</button>
);
};
{ connect }
theme.display = (m) => ReactDOM.render(
theme.counter(m.count, actions.click),
document.getElementById('container')
)
var Counter = ({count, action}) => (
<button onClick={action}>
Click me! Number of clicks: {count}
</button>
)
theme.counter = (c, a) => <Counter count={c} action={a} />;
but neither of them composes well.
From the github/#1528 discussion:
I feel quite unhappy with Redux after my app became quite large, with many side effects and quite strong coupling between reducers, actions and appropriated react components (via connect(..)). Initially i've created separate actions, sagas, reducers, react component for each "feature" of the app, but it became too complex very quickly - anyway all these files 'import's each other a lot and cannot be splitted into different npm packages. So I'm still looking for less-coupling solution.
Not really surprised