My case is as follows:
function * uploadFile({file}) {
Papa.parse(file, {
header: true,
complete: function(results) {
console.log(results.data);
//if errors => call uploadFailed action with yield
//else yield put(uploadSucceed)
}
});
}
The commented code cannot be called because it's not a generator function. If I add the * to the callback definition, there's no error but it doesn't work.
I've also tried wrapping it in another function that accepts a callback without any luck. Walked through several answers like 1 2 but these aren't my case. Also there's no documentation on Papa with redux as far as I've come to see. Any help would be appreciated.
BTW:
complete: yield call(someAction) //doesn't work as well.