Converting functions from pure react to redux react
问题 In pure react, I have written a function that I call in componentDidMount () : getTasks = (userId, query, statusTask, pageNumber) => { let check = {}; axios({ url: `/api/v1/beta/${userId}`, method: 'GET' }) .then(res => { check = res.data; if (res.data) { this.setState({ checkRunning: res.data, checkRunningId: res.data.id }); this.utilizeTimes(res.data.task_id); } }) .catch(error => { console.log(error); }) .then(() => { const params = { sort: 'name' }; if (query) { params['filter[qwp]'] =