no message
This commit is contained in:
@@ -2,11 +2,34 @@ import countUI from '../../components/count'
|
|||||||
import {connect} from 'react-redux'
|
import {connect} from 'react-redux'
|
||||||
import {createIncreementAction,createDecreementAction,createIncreementAsyncAction} from '../../redux/count_action'
|
import {createIncreementAction,createDecreementAction,createIncreementAsyncAction} from '../../redux/count_action'
|
||||||
|
|
||||||
const mapStateToProps=state=>({state})
|
// 写法1
|
||||||
const mapDispatchToProps=dispatch=>({
|
// const mapStateToProps=state=>({state})
|
||||||
jia:data=>dispatch(createIncreementAction(data)),
|
// const mapDispatchToProps=dispatch=>({
|
||||||
jian:data=>dispatch(createDecreementAction(data)),
|
// jia:data=>dispatch(createIncreementAction(data)),
|
||||||
jiaAsync:(data,time)=>dispatch(createIncreementAsyncAction(data,time)),
|
// jian:data=>dispatch(createDecreementAction(data)),
|
||||||
})
|
// jiaAsync:(data,time)=>dispatch(createIncreementAsyncAction(data,time)),
|
||||||
const CountContainer=connect(mapStateToProps,mapDispatchToProps)(countUI)
|
// })
|
||||||
|
// const CountContainer=connect(mapStateToProps,mapDispatchToProps)(countUI)
|
||||||
|
|
||||||
|
// 写法2
|
||||||
|
// const CountContainer=connect(
|
||||||
|
// state=>({state}),
|
||||||
|
// dispatch=>({
|
||||||
|
// jia:data=>dispatch(createIncreementAction(data)),
|
||||||
|
// jian:data=>dispatch(createDecreementAction(data)),
|
||||||
|
// jiaAsync:(data,time)=>dispatch(createIncreementAsyncAction(data,time)),
|
||||||
|
// })
|
||||||
|
// )
|
||||||
|
// (countUI)
|
||||||
|
|
||||||
|
// 写法3
|
||||||
|
const CountContainer=connect(
|
||||||
|
state=>({state}),
|
||||||
|
{
|
||||||
|
jia:createIncreementAction,
|
||||||
|
jian:createDecreementAction,
|
||||||
|
jiaAsync:createIncreementAsyncAction,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
(countUI)
|
||||||
export default CountContainer
|
export default CountContainer
|
||||||
Reference in New Issue
Block a user