gets method

StateAsync<S, A> gets(
  1. A f(
    1. S state
    )
)

Change the value getter based on the current state S.

Implementation

StateAsync<S, A> gets(A Function(S state) f) =>
    StateAsync((state) async => (f(state), state));