The exit is inside. Then the promise response function throws an error
The following code is throwing an error:
syncData().then((x) => yield put(loginUserSuccess(responseData)));
Error: Reserved keyword 'yield'.
Data sync handles asynchronous data fetching operations. I want to use yield put (provided by sagas.js) to trigger the user login success of the action user after the sync data is done.
The core of the syncData function looks like this:
export default async function syncData(dataType) {
await Promise.all([syncData1(), syncData2()]);
}
+3
source to share