Created
May 30, 2016 12:34
-
-
Save jonnyreeves/bc53e56c2d924d083b1fefde8c75aea9 to your computer and use it in GitHub Desktop.
redux-middleware-counter.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Counter = props => { | |
const { count, dispatch } = props; | |
return ( | |
<div> | |
<p>Counter value: {props.value}</p> | |
<button onClick={() => dispatch({ type: 'INC' })}>++</button> | |
<button onClick={() => dispatch({ type: 'DEC' })}>--</button> | |
</div> | |
); | |
} | |
export default connect(state => state)(Counter); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment