Socket
Socket
Sign inDemoInstall

promise.reduce

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise.reduce

> "Returns a promise containing the reduced result from the provided function"


Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

promise.reduce

"Returns a promise containing the reduced result from the provided function"

NPM

Install

$ npm install promise.reduce --save

Usage

var map = require('promise.reduce')
var conat = (total, current) => Promise.resolve(total + current)

reduce([
  'a',
  'b',
  Promise.resolve('c')
], concat).then((result) => {
  console.log(result) // 'abc'
})

API

reduce(input..., reducerFn, initialValue) -> promise

Returns a promise containing the reduced result of the promisified mappingFn on its elements. Rejection occurs if any supplied promises reject.

input Iterable<Promise|any>

A sequence of promises or instanceof Iterable

mapperFn Function

A mapping function that returns a promise

initialValue Function

The initial value used in the reduction invocation

Keywords

FAQs

Package last updated on 27 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc