I've read that generators don't wait for promises. How come this is not the case with generators in redux-saga, and how do I make my own generators wait?
For example, this saga:
takeLatest('FETCH_USER_REQUESTED', function*() {
const fetchPromise = yield put(fetchUser());
const user = yield fetchPromise;
console.log(user)
yield 1
console.log(1)
})
will output:
Promise
Object // <= user data fetched asynchronously
1
instead of:
Promise
undefined
1