call method
Implementation
@override
Stream<TState> call(
Context<TState> context,
Event event,
NextMiddleware<TState> next,
) async* {
final logger = this.logger ?? Logger.root;
final executionId = _uniqueId++;
final stopwatch = Stopwatch()..start();
logger.fine('[$event]($executionId) Starting');
await for (final state in next(context, event)) {
yield state;
if (logState) {
logger.fine('[$event]($executionId) State updated : $state');
}
}
logger.fine('[$event]($executionId) Finished after ${stopwatch.elapsed}');
}