Last active
January 18, 2020 22:48
-
-
Save antonagestam/435d4aa2d20b01dc96449149b5c1e221 to your computer and use it in GitHub Desktop.
Variadic chain function for arbitrary number of iterables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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