Files
xen-orchestra/@vates/coalesce-calls
Julien Fontanet 2a70ebf667 docs: uniformize code blocks
- add missing syntaxes
- don't put prompt if no command outputs to ease copy/paste and use `sh` syntax
- always use `$` as prompt and use `console` syntax
2023-02-06 11:25:12 +01:00
..
2022-02-18 17:11:52 +01:00
2023-02-06 11:25:12 +01: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