# @mudita/delay-response-function

> Delays async function to be resolved not earlier than after given time.

Latest version **1.0.2** (published 2021-02-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mudita/delay-response-function
pnpm add @mudita/delay-response-function
yarn add @mudita/delay-response-function
bun add @mudita/delay-response-function
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-02-16 |
| First published | 2021-02-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | mudita |
| Maintainers | piotrleniec-mudita, staszewski, andrzejbogdol, igor.bezsmertnyi, xunaix, mateuszkocz |
| Keywords | delay, response, async, mudita |

## Links

- npm: https://www.npmjs.com/package/@mudita/delay-response-function
- Repository: https://github.com/mudita/mudita-libs/tree/master/packages/mudita-delay-response-function
- Homepage: https://github.com/mudita/mudita-libs/tree/master/packages/mudita-delay-response-function#readme
- Issues: https://github.com/mudita/mudita-libs/issues
- npm.io page: https://npm.io/package/@mudita/delay-response-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.2 (latest) — 2021-02-16
- 1.0.1 — 2021-02-16

## README

<p align="center">
  <a href="https://mudita.com">
    <img alt="Mudita" src="/mudita-logo.svg" width="160" />
  </a>
</p>
<h1 align="center">
  Delay response function
</h1>

An async function that delays other async function to be resolved not earlier than after given time.

## Install

```
npm install @mudita/delay-response-function

# or

yarn add @mudita/delay-response-function
```

## Usage

```TS
await delayResponse(somePromise, timeInMsToResolve)
```

## Example

```TS
const fakePromise = () =>
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve("resolved")
    }, 125)
  })

const data = await delayResponse(fakePromise, 1000)

// Console will log after 1s even though fakePromise was resolved in 125ms
console.log(data) // "resolved"
```

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