yield take() ignores actions put() in the same saga?
jchook opened this issue · comments
Wes Roberts commented
Description
I would expect this saga to create an infinite loop, putting and taking the same action over and over. However, it does not. Actions put()
from the same while-loop are invisible to take()
.
function* minimalSaga(): any {
while (true) {
const action = yield take()
console.log(action)
yield put(action)
}
}
Is this by design? Is it a bug?
Here is a full repro.
Related Issues:
Wes Roberts commented
I think I see why now -- to capture an action, yield take()
must be blocking while yield put()
is called.