UNPKG

@jasmith79/sequable

Version:

Library functions for working with generators

19 lines (18 loc) 427 B
import { toIterable } from "./sequable.mjs"; /** * Yields all of the items from sequence a then all of the items of sequence * b. * * @param a The first sequence to combine. * @param b The second sequence to combine. */ export function concat(a, b) { const as = toIterable(a); const bs = toIterable(b); return { *[Symbol.iterator]() { yield* as; yield* bs; }, }; }