FlushChannel class

Creates an effect that instructs the middleware to flush all buffered items from the channel. Flushed items are returned back to the saga, so they can be utilized if needed.

Example

 import 'package:redux_saga/redux_saga.dart';

 //...

 saga() sync* {
   var chan = Result<Channel>();
   yield ActionChannel(Action, result: chan);

   yield Try(() sync* {
     while (true) {
       var action = Result();
       yield Take(channel: chan.value, result: action);
       // ...
     }
   }, Finally: () sync* {
     var actions = Result();
     yield FlushChannel(chan.value, result: actions);
     // ...
   });
 }
Inheritance

Constructors

FlushChannel(Channel channel, {Result? result})
Creates an instance of FlushChannel effect.

Properties

channel Channel
Channel to flush.
final
hashCode int
The hash code for this object.
no setterinherited
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