@khirayama/react-circuit
v1.0.1
Published
Official React bindings for [Circuit](https://github.com/khirayama/circuit).
Downloads
2
Maintainers
Readme
React Circuit
Official React bindings for Circuit.
Installation
npm install --save @khirayama/react-circuit
Documentation
Examples
Ref: Examples
createStore({total: 0}, (state, action) => {
switch (action.type) {
case 'COUNT_UP':
state.total += 1;
break;
case 'COUNT_DOWN':
state.total -= 1;
break;
default:
break;
}
return state;
});
export default class CountContainer extends Container {
render() {
return (
<section>
<h1>Count: {this.state.total}</h1>
<CountButton onCountButtonClick={countUp(this.dispatch)}>Count up +1</CountButton>
<CountButton onCountButtonClick={countDown(this.dispatch)}>Count down -1</CountButton>
</section>
);
}
}