first commit
This commit is contained in:
24
src/actions/counter.js
Normal file
24
src/actions/counter.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import {
|
||||
ADD,
|
||||
MINUS
|
||||
} from '../constants/counter'
|
||||
|
||||
export const add = () => {
|
||||
return {
|
||||
type: ADD
|
||||
}
|
||||
}
|
||||
export const minus = () => {
|
||||
return {
|
||||
type: MINUS
|
||||
}
|
||||
}
|
||||
|
||||
// 异步的action
|
||||
export function asyncAdd () {
|
||||
return dispatch => {
|
||||
setTimeout(() => {
|
||||
dispatch(add())
|
||||
}, 2000)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user