Skip to content

Instantly share code, notes, and snippets.

@antonagestam
Last active January 18, 2020 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonagestam/435d4aa2d20b01dc96449149b5c1e221 to your computer and use it in GitHub Desktop.
Save antonagestam/435d4aa2d20b01dc96449149b5c1e221 to your computer and use it in GitHub Desktop.
Variadic chain function for arbitrary number of iterables
export function* chain<A>(...iterables: Iterable<A>[]): Iterable<A> {
for (const iterable of iterables) yield* iterable
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment