Last active
April 18, 2016 12:59
-
-
Save afc163/481aa50b5befcd107002a16be6a1aa7b to your computer and use it in GitHub Desktop.
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
import styles from './Count.module.less'; | |
import React from 'react'; | |
import classnames from 'classnames'; | |
import { Button } from 'antd'; | |
import { COUNT_INCREASE, COUNT_INCREASE_ASYNC, COUNT_DECREASE } from '../../constants/count'; | |
const Count = ({ dispatch, count }) => | |
<div> | |
<div>{count}</div> | |
<Button | |
className={styles.button} | |
onClick={() => { dispatch({ type: COUNT_INCREASE }); }}>+</Button> | |
<Button | |
className={styles.button} | |
onClick={() => { dispatch({ type: COUNT_DECREASE }); }}>-</Button> | |
<Button className={styles.button} type="primary" | |
onClick={() => { dispatch({ type: COUNT_INCREASE_ASYNC }); }}>+ (async)</Button> | |
</div> | |
export default Count; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment