chainFirst<C> method
Chain a request that returns another State, execute it, ignore the result, and return the same value as the current State.
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
State<S, A> chainFirst<C>(
covariant State<S, C> Function(A a) chain,
) =>
flatMap((a) => chain(a).map((_) => a));