Cancelled class

Creates an effect that instructs the middleware to return whether this generator has been cancelled. Typically you use this Effect in a finally block to run Cancellation specific code.

Example

 import 'package:redux_saga/redux_saga.dart';

 //...

 saga() sync* {
   yield Try(() sync* {
     // ...
   }, Finally: () sync* {
     var cancelled = Result<bool>();
     yield Cancelled(result: cancelled);

     if (cancelled.value) {
       // logic that should execute only on Cancellation
     }
     // logic that should execute in all situations (e.g. closing a channel)
   });
 }
Inheritance

Constructors

Cancelled({Result? result})
Creates an instance of a Cancelled effect.

Properties

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