xen-orchestra/@vates/coalesce-calls
Julien Fontanet 3f42199f8f feat(normalize-packages): dont use files field
A centralized npmignore is easier to use and maintain.
2021-04-23 14:47:34 +02:00
..
.npmignore feat: unified .npmignore for all packages 2021-04-07 13:58:14 +02:00
index.js feat(@vates/coalesce-calls): 0.1.0 2020-06-29 15:33:53 +02:00
index.spec.js feat(@vates/coalesce-calls): 0.1.0 2020-06-29 15:33:53 +02:00
package.json feat(normalize-packages): dont use files field 2021-04-23 14:47:34 +02:00
README.md chore: normalize packages 2020-10-23 10:21:52 +02:00
USAGE.md fix(coalesce-calls/README): fix import 2020-06-29 15:39:14 +02:00

@vates/coalesce-calls

Package Version License PackagePhobia Node compatibility

Wraps an async function so that concurrent calls will be coalesced

Install

Installation of the npm package:

> npm install --save @vates/coalesce-calls

Usage

import { coalesceCalls } from '@vates/coalesce-calls'

const connect = coalesceCalls(async function () {
  // async operation
})

connect()

// the previous promise result will be returned if the operation is not
// complete yet
connect()

Contributions

Contributions are very welcomed, either on the documentation or on the code.

You may:

  • report any issue you've encountered;
  • fork and create a pull request.

License

ISC © Vates SAS