chainFirst<C> method
Chain a request that returns another StateAsync, execute it, ignore the result, and return the same value as the current StateAsync.
Note: chainFirst
will not change the value of first
for the state,
but it will change the value of second
when calling run()
.
Implementation
@override
StateAsync<S, A> chainFirst<C>(
covariant StateAsync<S, C> Function(A a) chain,
) =>
flatMap((a) => chain(a).map((_) => a));