flatMap<C> method
Used to chain multiple functions that return a StateAsync.
Implementation
@override
StateAsync<S, C> flatMap<C>(covariant StateAsync<S, C> Function(A a) f) =>
StateAsync((state) async {
final tuple = await run(state);
return f(tuple.$1).run(tuple.$2);
});