I recently needed a blazing fast concurrent to fetch items from an API. Of course, I could use a combination of async-awaits and some cryptic code with promises and so I took a stab at doing this in rxjs.
import { Observable } from 'rxjs';
export function doPaginate<T>(
fetchPage: (page: number) => Promise<{ totalRows: number; resultItems: T[] }>,
): Observable<T> {