# asynccallguard

> Make all calls to a function queued and asynchronously guarded

Latest version **0.0.2** (published 2013-04-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install asynccallguard
pnpm add asynccallguard
yarn add asynccallguard
bun add asynccallguard
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2013-04-13 |
| First published | 2013-04-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Francois-Guillaume Ribreau |
| Maintainers | fgribreau |
| Keywords | function, fp, async |

## Links

- npm: https://www.npmjs.com/package/asynccallguard
- Repository: https://github.com/FGRibreau/node-asynccallguard
- npm.io page: https://npm.io/package/asynccallguard

## 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.0.2 (latest) — 2013-04-13
- 0.0.1 — 2013-04-13

## README

AsyncCallGuard [![Build Status](https://drone.io/github.com/FGRibreau/node-asynccallguard/status.png)](https://drone.io/github.com/FGRibreau/node-asynccallguard/latest)
--------------

Make all calls to a function queued and asynchronously guarded

## NPM
Install the module with: `npm install asynccallguard`

## Usage

```javascript
var AsyncCallGuard = require('asynccallguard');

var w  = 100;
var f  = function(){console.log(Array.prototype.slice.call(arguments));};
var f2 = AsyncCallGuard(f, function MyGuard(fcall){
  //
  // ... Some complex logic here...
  //
  w *= 2;
  console.log('MyGuard was called, waiting for '+w+'ms before running f');
  setTimeout(fcall, w);
});

// Make multiple calls
f2();
f2(1,2);
f2(3,4);
f2(5,6,7);

// Produce:
// MyGuard was called, waiting for 200ms before running f
// []
// MyGuard was called, waiting for 400ms before running f
// [ 1, 2 ]
// MyGuard was called, waiting for 800ms before running f
// [ 3, 4 ]
// MyGuard was called, waiting for 1600ms before running f
// [ 5, 6, 7 ]

```


## Release History
v1.0.0 - Initial commit (13 apr. 2012)

## License
Copyright (c) 2013 Francois-Guillaume Ribreau
Licensed under the MIT license.

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