# use-cooldown

> A React hook implementation for client-side rate limiting.

Latest version **1.0.8** (published 2019-08-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install use-cooldown
pnpm add use-cooldown
yarn add use-cooldown
bun add use-cooldown
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2019-08-22 |
| First published | 2019-08-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 976.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | vincentvella |
| Maintainers | vvella |

## Links

- npm: https://www.npmjs.com/package/use-cooldown
- Repository: https://github.com/vincentvella/use-cooldown
- Homepage: https://github.com/vincentvella/use-cooldown#readme
- Issues: https://github.com/vincentvella/use-cooldown/issues
- npm.io page: https://npm.io/package/use-cooldown

## Recent versions

- 1.0.8 (latest) — 2019-08-22
- 1.0.7 — 2019-08-20
- 1.0.5 — 2019-08-20
- 1.0.0 — 2019-08-20

## README

# use-cooldown

> A React hook implementation for client-side rate limiting.

[![NPM](https://img.shields.io/npm/v/use-cooldown.svg)](https://www.npmjs.com/package/use-cooldown) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![Build Status](https://travis-ci.org/vincentvella/use-cooldown.svg?branch=master)](https://travis-ci.org/vincentvella/use-cooldown)

## Install

```bash
npm install --save use-cooldown
```

## Usage

```tsx
import * as React from 'react';
import { useCooldown } from 'use-cooldown';

const Example = () => {
  const [cooledDown, setCooledDown] = useCooldown(1000); // pass in length of cooldown in ms
  const startCooldown = () => setCooledDown(false);
  return (
    <div>
      <div>{`${cooledDown}`}</div>
      <button disabled={!cooledDown} onClick={startCooldown}>
        Begin Cooldown
      </button>
    </div>
  );
};
```

## License

MIT © [vincentvella](https://github.com/vincentvella)

---

This hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).

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