then<U> method
Fluent helper to attach a next step with full type inference.
Implementation
ParallelRequest<T> then<U>(
ParallelRequest<U> Function(List<T> previousResults) buildNext,
) {
return ParallelRequest<T>(
filters: filters,
id: id,
adapter: adapter,
next: (prev) => buildNext(prev.cast<T>()) as ParallelRequest<dynamic>,
);
}