a

a
mail@pastecode.io avatar
unknown
dart
2 years ago
554 B
1
Indexable
Never
import 'package:retrofit/retrofit.dart';

import 'data_state.dart';

typedef ConditionOperator = Function();
typedef ConditionErrorOperator<T> = Function(T?);

abstract class INetworkOperator<T> {
  final ConditionOperator? onAuthorizationFail;
  final ConditionErrorOperator<List<String>>? onFail;
  final ConditionOperator? onSuccess;
  final Future<HttpResponse<T>> requestFunction;

  INetworkOperator({
    required this.requestFunction,
    this.onSuccess,
    this.onAuthorizationFail,
    this.onFail,
  });

  Future<DataState<T>?> request();
}