scopeAsyncStateSync<T extends Object, CA extends ReducerAction, CE> method

StoreInterface<AsyncState<T>, E, AsyncStateAction> scopeAsyncStateSync<T extends Object, CA extends ReducerAction, CE>({
  1. required FutureOr<T> loader(
    1. E
    ),
  2. required AsyncState<T> toChildState(
    1. S
    ),
  3. required S fromChildState(
    1. S,
    2. AsyncState<T>
    ),
})

Implementation

StoreInterface<AsyncState<T>, E, AsyncStateAction>
    scopeAsyncStateSync<T extends Object, CA extends ReducerAction, CE>(
        {required FutureOr<T> Function(E) loader,
        required AsyncState<T> Function(S) toChildState,
        required S Function(S, AsyncState<T>) fromChildState}) {
  return scopeSyncState(
      toChildState: toChildState,
      fromChildState: fromChildState,
      childReducer: asyncStateReducer(loader),
      toChildEnvironment: (env) => env);
}