Consider this scenario:
function* mySaga(){
const x = yield call(getX)
}
The value of const x
is not determined directly by the return value of call(getX())
. Instead, it depends on what is passed in mySaga.next(whatever)
when it is invoked.
One might assume that redux-saga handles the saga intelligently by automatically calling the .next()
method with the result of the last promise yielded.
But can we really be sure?
How trustworthy is it to simply believe that x
represents the outcome of getX()
?