redux-saga 'call' is not defined no-undef

Viewed 1574

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()
    ])
}

In info-component.js

componentDidMount(){
    componentDidMount() {
        this.props.dispatch({type: "CREATE_USER_BUSINESS_INFO_SAGA", data: {asdf : 444} });
    }
}

Error

Error

1 Answers
Related