0
saga.js終極版 - 傳奇 '叫' 沒有定義沒有民主基金
import { delay } from 'redux-saga'
import { put, takeLatest, all } from 'redux-saga/effects'
import axios from 'axios';
function fire(data) {
return axios.post('http://localhost:3131/createUserBusinessInfo', data).then(function (response) {
return response;
}).catch(function (error) {
return error;
});
}
export function* createUserBusinessInfo(action) {
console.log(UserBusinessInfoService)
const userData = yield call(fire, action);
yield put({
type: 'CREATE_USER_BUSINESS_INFO',
userData
});
}
export function* createUserBusinessInfoSaga() {
yield takeLatest('CREATE_USER_BUSINESS_INFO_SAGA', createUserBusinessInfo);
}
export default function* rootSaga() {
yield all([
helloSaga(),
createUserBusinessInfoSaga()
])
}
在信息-component.js
componentDidMount(){
componentDidMount() {
this.props.dispatch({type: "CREATE_USER_BUSINESS_INFO_SAGA", data: {asdf : 444} });
}
}
錯誤