getStreamed<T> method

  1. @override
Stream<Result<T>> getStreamed<T>(
  1. String path, {
  2. Map<String, dynamic>? queryParameters,
  3. FutureOr<T> parser(
    1. dynamic data
    )?,
  4. RestApiClientRequestOptions? options,
})
override

Implementation

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

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

  yield await get(
    path,
    queryParameters: queryParameters,
    parser: parser,
    options: options,
  );
}