# dedup-function

> JS module to dedup function calls

Latest version **1.0.0** (published 2016-07-13) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install dedup-function
pnpm add dedup-function
yarn add dedup-function
bun add dedup-function
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-07-13 |
| First published | 2016-07-13 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sam Thorogood |
| Maintainers | samthor |
| Keywords | dedup, timeout, promise |

## Links

- npm: https://www.npmjs.com/package/dedup-function
- Repository: https://github.com/samthor/dedup
- Homepage: https://github.com/samthor/dedup#readme
- Issues: https://github.com/samthor/dedup/issues
- npm.io page: https://npm.io/package/dedup-function

## 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

- 1.0.0 (latest) — 2016-07-13

## README

JS module to dedup function calls.
Requires that your environment has `Promise`, or that it's been [provided by a polyfill](https://github.com/stefanpenner/es6-promise#auto-polyfill).

Usage-

```js
const dedup = require('dedup-function');

function expensiveOperation() {
  // do some stuff
  return 42;
}

const sometimesExpensiveOperation = dedup(expensiveOperation, 5000);
sometimesExpensiveOperation().then(result => {
  console.info('This value is probably going to be 42, is it?', result);
}).catch(err => {
  console.info('Got error', err);
});

```

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