Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

promise-inflight

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Issues
File Explorer

Advanced tools

promise-inflight

One promise for multiple requests in flight to avoid async duplication

    1.0.1latest

Version published
Maintainers
1
Weekly downloads
13,434,433
decreased by-11.46%

Weekly downloads

Readme

Source

promise-inflight

One promise for multiple requests in flight to avoid async duplication

USAGE

const inflight = require('promise-inflight') // some request that does some stuff function req(key) { // key is any random string. like a url or filename or whatever. return inflight(key, () => { // this is where you'd fetch the url or whatever return Promise.delay(100) }) } // only assigns a single setTimeout // when it dings, all thens get called with the same result. (There's only // one underlying promise.) req('foo').then(…) req('foo').then(…) req('foo').then(…) req('foo').then(…)

SEE ALSO

  • inflight - For the callback based function on which this is based.

STILL NEEDS

Tests!

FAQs

What is promise-inflight?

One promise for multiple requests in flight to avoid async duplication

Is promise-inflight popular?

The npm package promise-inflight receives a total of 10,734,434 weekly downloads. As such, promise-inflight popularity was classified as popular.

Is promise-inflight well maintained?

We found that promise-inflight demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 26 Feb 2017

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc