safeCallLocalCache<T> method

Future<Either<FetchFailure, T>> safeCallLocalCache<T>(
  1. T? response
)

Implementation

Future<Either<FetchFailure, T>> safeCallLocalCache<T>(T? response) async {
  try {
    if (response != null) {
      return await right(response);
    } else {
      return await left(const FetchFailure.nothing());
    }
  } catch (e) {
    return await left(const FetchFailure.nothing());
  }
}