Skip to content

Instantly share code, notes, and snippets.

@vitaly-t
Created November 5, 2022 14:24
Show Gist options
  • Save vitaly-t/de30ca8676570570a8577ce9313bf968 to your computer and use it in GitHub Desktop.
Save vitaly-t/de30ca8676570570a8577ce9313bf968 to your computer and use it in GitHub Desktop.
import {pipeAsync, map, waitRace, delay} from 'iter-ops';
const i = pipeAsync(
[1, 2, 3],
map(s => Promise.resolve(s * 10)),
delay(100),
waitRace(3)
);
(async function () {
for await (const a of i) {
console.log(a);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment