TakeMaybe class

Same as Take but does not automatically terminate the Saga on an End action. Instead all Sagas blocked on a take Effect will get the End object.

It is exactly same as Take effect with Take.maybe is true.

Notes

TakeMaybe is 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:

  • case when there is a Just(Action) (we have an action)
  • the case of Nothing (channel was closed). i.e. we need some way to map over End.
  • internally all dispatched actions are going through the stdChannel which is getting closed when dispatch(End) happens.
Inheritance

Constructors

TakeMaybe({dynamic pattern, Channel? channel, Result? result})
Creates an instance of a TakeMaybe effect.

Properties

channel Channel?
Instructs the middleware to wait for a specified message from the provided Channel. If the channel is already closed, then the Generator will immediately terminate following the same process described for Take.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
maybe bool
If true Take does not automatically terminate the Saga on an End action. Instead all Sagas blocked on a take Effect will get the End object. Check TakeMaybe also.
finalinherited
pattern → dynamic
Actions only matching pattern is taken.
finalinherited
result Result?
Result after effect is resolved.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getDefinition() Map<String, dynamic>
Returns all properties of effect as a dictionary object
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited