// redux-thunk
const fetchData = (params) => (dispatch) => {
setTimeout(() => {
dispatch({action: "GET_DATA", payload: 111})
})
}
// dispatch
const fetchData = (params) => ({action: "GET_DATA", payload: 111});
setTimeout(() => {
dispatch(fetchData(...))
})
I don"t understand the difference between the two ways.
ask the boss to give an example to illustrate. Thank you very much