Skip to content

Instantly share code, notes, and snippets.

@afc163
Last active April 18, 2016 12:59
Show Gist options
  • Save afc163/481aa50b5befcd107002a16be6a1aa7b to your computer and use it in GitHub Desktop.
Save afc163/481aa50b5befcd107002a16be6a1aa7b to your computer and use it in GitHub Desktop.
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