call method
Implementation
@override
Stream<TState> call(
Context<TState> context,
Event event,
NextMiddleware<TState> next,
) async* {
final initialState = context.state;
try {
await for (final event in next(context, event)) {
yield event;
}
} catch (error, stackTrace) {
final errorEvent = onFailed(
context,
event,
initialState,
error,
stackTrace,
);
await for (final event in call(context, errorEvent, next)) {
yield event;
}
}
}