const next = (a) => Promise.all([a, asyncIterator.next()])
.then(concat);
const concat = ([a, {value, done}]) => {
if (done) return a;
a.push(value);
return next(a);
};
return Promise.resolve([]).then(next);
}
I forgot to push the value lol, edited!
I tidied it up some more :3
Обсуждают сегодня