postStreamed<T> method

  1. @override
Stream<Result<T>> postStreamed<T>(
  1. String path, {
  2. dynamic data,
  3. Map<String, dynamic>? queryParameters,
  4. FutureOr<T> onSuccess(
    1. dynamic data
    )?,
  5. FutureOr<T> onError(
    1. dynamic data
    )?,
  6. RestApiClientRequestOptions? options,
})
override

Implementation

@override
Stream<Result<T>> postStreamed<T>(
  String path, {
  data,
  Map<String, dynamic>? queryParameters,
  FutureOr<T> Function(dynamic data)? onSuccess,
  FutureOr<T> Function(dynamic data)? onError,
  RestApiClientRequestOptions? options,
}) async* {
  if (_options.cacheEnabled) {
    final cachedResult = await postCached(
      path,
      queryParameters: queryParameters,
      data: data,
      onSuccess: onSuccess,
    );

    if (cachedResult.hasData) {
      yield cachedResult;
    }
  }

  yield await post(
    path,
    queryParameters: queryParameters,
    data: data,
    onSuccess: onSuccess,
    options: options,
  );
}