getStreamed<T> method
Stream<Result<T> >
getStreamed<T>(
- String path, {
- Map<
String, dynamic> ? queryParameters, - FutureOr<
T> onSuccess(- dynamic data
- FutureOr<
T> onError(- dynamic data
- RestApiClientRequestOptions? options,
override
Implementation
@override
Stream<Result<T>> getStreamed<T>(
String path, {
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 getCached(
path,
queryParameters: queryParameters,
onSuccess: onSuccess,
);
if (cachedResult.hasData) {
yield cachedResult;
}
}
yield await get(
path,
queryParameters: queryParameters,
onSuccess: onSuccess,
options: options,
);
}