no message

This commit is contained in:
macbook
2024-04-27 21:23:52 +08:00
parent f8b126bf44
commit 9d8830a9ac
@@ -2,11 +2,34 @@ import countUI from '../../components/count'
import {connect} from 'react-redux'
import {createIncreementAction,createDecreementAction,createIncreementAsyncAction} from '../../redux/count_action'
const mapStateToProps=state=>({state})
const mapDispatchToProps=dispatch=>({
jia:data=>dispatch(createIncreementAction(data)),
jian:data=>dispatch(createDecreementAction(data)),
jiaAsync:(data,time)=>dispatch(createIncreementAsyncAction(data,time)),
})
const CountContainer=connect(mapStateToProps,mapDispatchToProps)(countUI)
// 写法1
// const mapStateToProps=state=>({state})
// const mapDispatchToProps=dispatch=>({
// jia:data=>dispatch(createIncreementAction(data)),
// jian:data=>dispatch(createDecreementAction(data)),
// jiaAsync:(data,time)=>dispatch(createIncreementAsyncAction(data,time)),
// })
// 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