export default function* (length: number, producer: () => T) { for (let i = 0; i < length; i++) { yield producer(); } }