SimpleSagaMonitor class

Monitors running sagas and effects to track middleware Output can be printed to console.

 ...
 var monitor = SimpleSagaMonitor(
     onLog: consoleMonitorLogger);

 var sagaMiddleware = createSagaMiddleware(Options(sagaMonitor: monitor));
 ...

To handle where to log implement onLog event. Following example demonstrates how to get lines and output them to a div element on an html page.

 ...
 var monitor = SimpleSagaMonitor(
     onLog: (SimpleSagaMonitor monitor) {
       var lines = monitor.getLines();
       String s = '';
       lines.forEach((element) {
         s += element + '</br>';
       });
       querySelector('#monitor').innerHtml = s;
     });

 var sagaMiddleware = createSagaMiddleware(Options(sagaMonitor: monitor));
 ...

Constructors

SimpleSagaMonitor({bool verbose = false, bool treeLines = true, MonitorLogHandler? onLog})
Creates an instance of a SimpleSagaMonitor

Properties

hashCode int
The hash code for this object.
no setterinherited
onLog MonitorLogHandler?
Invoked on every new log entry
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
treeLines bool
If true shows tree lines
getter/setter pair
verbose bool
If true monitor gives more details
getter/setter pair

Methods

actionDispatched(dynamic action) → void
Defines function type which is invoked when a Redux action is dispatched
override
effectCancelled(int effectId) → void
Defines function type which is invoked when an effect is cancelled by the middleware
override
effectRejected(int effectId, dynamic error) → void
Defines function type which is invoked when an effect is rejected by the middleware
override
effectResolved(int effectId, dynamic result) → void
Defines function type which is invoked when an effect is successfully resolved by the middleware
override
effectTriggered(int effectId, int parentEffectId, dynamic label, dynamic effect) → void
Defines function type which is invoked when an effect triggered by the middleware
override
getLines() List<String>
Returns log lines as a string array
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
printToConsole() → void
Prints everything to the console
rootSagaStarted(int effectId, Function saga, List? args, Map<Symbol, dynamic>? namedArgs, String? name) → void
Defines function type which is invoked when a root saga is starts
override
toString() String
A string representation of this object.
inherited

Operators

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