Promise holder.
Like Promise.all() but runs in series instead of parallel. Will pass the value of the prev func as the input to the next one, therefore a pipeline is simulated.
Array with functions that return a promise.
Initial value of the processing chain.
Results of the tasks.
Synchronizes operation and ensures that it won't be executed concurrently.
Example:
async function makeApiCall() {
// function body
}
const nonConcurrentApiCallMaker = synchronize(makeApiCall);
// makeApiCall
will be called only once
const results = await Promise.all([
nonConcurrentApiCallMaker(),
nonConcurrentApiCallMaker()
]);
expect(results[0]).to.be.eq(results[1]);
Convert value into promise.
Value or promise.
Converted promise.
Builds PromiseHolder instance.