Skip to main content
100%

run promises sequentially or not using observables

✓ Published0🌍 Public
RRestuta
Last edited Dec 28, 2022
Created on Dec 28, 2022

This example demonstrates how to execute arrays of promises sequentially or in controlled batches using RxJS observables. It shows a stream of numeric values piped through operators like `map`, `defer`, and `mergeAll` with a concurrency limit of 1, ensuring each promise resolves before the next starts. A second variant uses `bufferCount(3)` to group the input into batches of three, still processing them one batch at a time. The `delay` helper creates promises that log their resolved values to the console, with a final `console.log('done')` indicating stream completion.

AI-generated description

Similar vizzes