# @vates/coalesce-calls

> Wraps an async function so that concurrent calls will be coalesced

Latest version **0.1.0** (published 2020-06-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install @vates/coalesce-calls
pnpm add @vates/coalesce-calls
yarn add @vates/coalesce-calls
bun add @vates/coalesce-calls
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-06-29 |
| First published | 2020-06-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.10 |
| Dependencies | 0 |
| Unpacked size | 2.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 988 |
| Author | Vates SAS |
| Maintainers | olivierlambert, marsaud, julien-f |
| Keywords | async, calls, coalesce, decorate, decorator, merge, promise, wrap, wrapper |

## Links

- npm: https://www.npmjs.com/package/@vates/coalesce-calls
- Repository: https://github.com/vatesfr/xen-orchestra
- Homepage: https://github.com/vatesfr/xen-orchestra/tree/master/@vates/coalesce-calls
- Issues: https://github.com/vatesfr/xen-orchestra/issues
- npm.io page: https://npm.io/package/@vates/coalesce-calls

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2020-06-29

## README

<!-- DO NOT EDIT MANUALLY, THIS FILE HAS BEEN GENERATED -->

# @vates/coalesce-calls

[![Package Version](https://badgen.net/npm/v/@vates/coalesce-calls)](https://npmjs.org/package/@vates/coalesce-calls) ![License](https://badgen.net/npm/license/@vates/coalesce-calls) [![PackagePhobia](https://badgen.net/bundlephobia/minzip/@vates/coalesce-calls)](https://bundlephobia.com/result?p=@vates/coalesce-calls) [![Node compatibility](https://badgen.net/npm/node/@vates/coalesce-calls)](https://npmjs.org/package/@vates/coalesce-calls)

> Wraps an async function so that concurrent calls will be coalesced

## Install

Installation of the [npm package](https://npmjs.org/package/@vates/coalesce-calls):

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

## Usage

```js
import { coalesceCalls } from '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](https://github.com/vatesfr/xen-orchestra/issues)
  you've encountered;
- fork and create a pull request.

## License

[ISC](https://spdx.org/licenses/ISC) © [Vates SAS](https://vates.fr)

---
_Source: https://npm.io/package/@vates/coalesce-calls · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
