Is this considered non blocking or can the first take be dropped/missed if action1 is dispatched multiple times?
function* nonBlockingSaga () {
while (true) {
yield take('action1');
yield take('action2');
yield take('action3');
}
}
Yes, if you dispatch
action1
, the saga will be blocked bytake('action2')
and you will miss anyaction1
actions until the saga loops around. To work around/solve this you can use an action channel. An action channel allows you to buffer the actions until your saga is ready to take them.So in you example this would result in:
This way you will never miss any of the actions.