Optional
pattern: ActionPatternSame as take(pattern)
but does not automatically terminate the Saga on an
END
action. Instead all Sagas blocked on a take Effect will get the END
object.
takeMaybe
got its name from the FP analogy - it's like instead of having a
return type of ACTION
(with automatic handling) we can have a type of
Maybe(ACTION)
so we can handle both cases:
Just(ACTION)
(we have an action)NOTHING
(channel was closed*). i.e. we need some way to map
over END
internally all dispatch
ed actions are going through the stdChannel
which
is getting closed when dispatch(END)
happens
Optional
pattern: ActionPattern<A>
Same as
take(pattern)
but does not automatically terminate the Saga on anEND
action. Instead all Sagas blocked on a take Effect will get theEND
object.Notes
takeMaybe
got its name from the FP analogy - it's like instead of having a return type ofACTION
(with automatic handling) we can have a type ofMaybe(ACTION)
so we can handle both cases:Just(ACTION)
(we have an action)NOTHING
(channel was closed*). i.e. we need some way to map overEND
internally all
dispatch
ed actions are going through thestdChannel
which is getting closed whendispatch(END)
happens