convertResponseToState method

  1. @override
Future<Either<GeneralFailure, Data>> convertResponseToState(
  1. Event event,
  2. FutureArgAction<Data, Event> requestAction
)
override

Implementation

@override
Future<Either<GeneralFailure, Data>> convertResponseToState(
  Event event,
  FutureArgAction<Data, Event> requestAction,
) async {
  try {
    return right(await requestAction(event));
  } catch (e, st) {
    return left(GeneralFailure(error: e, stackTrace: st));
  }
}