fetch method

void fetch(
  1. Future<ValuableList> resolver
)
inherited

Fetch resolver

Implementation

void fetch(Future<R> resolver) {
  if (state is! LoadingState || !init) {
    init = true;
    emit(FetchLoading<R>());
    _resolver = CancelableOperation.fromFuture(resolver);
    _resolver?.value.then((result) {
      emit(FetchSuccess<R>(result));
    }).catchError((e, s) {
      emit(FetchFail<R>(FailResult(e, s)));
    });
  }
}