p-waterfall

WebJar for p-waterfall

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

p-waterfall
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

p-waterfall
WebJar for p-waterfall
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/p-waterfall

Download p-waterfall

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/p-waterfall/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>p-waterfall</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/p-waterfall/
implementation 'org.webjars.npm:p-waterfall:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/p-waterfall/
implementation ("org.webjars.npm:p-waterfall:1.0.0")
'org.webjars.npm:p-waterfall:jar:1.0.0'
<dependency org="org.webjars.npm" name="p-waterfall" rev="1.0.0">
  <artifact name="p-waterfall" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='p-waterfall', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "p-waterfall" % "1.0.0"
[org.webjars.npm/p-waterfall "1.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : p-reduce jar [1.0.0,2)

Project Modules

There are no modules declared in this project.

p-waterfall

Run promise-returning & async functions in series, each passing its result to the next

Install

$ npm install p-waterfall

Usage

import pWaterfall from 'p-waterfall';

const tasks = [
	initialValue => getEmoji(initialValue),
	previousValue => `I ❤️ ${previousValue}`
];

console.log(await pWaterfall(tasks, 'unicorn'));
//=> 'I ❤️ 🦄'

API

pWaterfall(tasks, initialValue?)

Returns a Promise that is fulfilled when all promises returned from calling the functions in tasks are fulfilled, or rejects if any of the promises reject. The fulfilled value is the value returned from the last task.

tasks

Type: Iterable<Function>

Functions are expected to return a value. If a Promise is returned, it's awaited before continuing with the next task.

initialValue

Type: unknown

Value to use as previousValue in the first task.

Related


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Versions

Version
1.0.0