Skip to content

Instantly share code, notes, and snippets.

@cartant
Last active May 13, 2018 07:10
Show Gist options
  • Select an option

  • Save cartant/11c56b547da81f1effb671f9acfc3d2f to your computer and use it in GitHub Desktop.

Select an option

Save cartant/11c56b547da81f1effb671f9acfc3d2f to your computer and use it in GitHub Desktop.
import { EMPTY, Observable } from "rxjs";
import { expand, map } from "rxjs/operators";
import { get } from "./github";
function pages<T>(uri: string): Observable<T[]> {
return get<T[]>(uri).pipe(
expand(({ next }) => next ? get(next) : EMPTY),
map(({ content }) => content)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment