# @hooks/interval

> React hook to wrap setInterval

Latest version **0.1.0** (published 2020-04-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @hooks/interval
pnpm add @hooks/interval
yarn add @hooks/interval
bun add @hooks/interval
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-04-28 |
| First published | 2020-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mike Simmonds |
| Maintainers | simmo |
| Keywords | react, hooks, useInterval, setInterval, interval |

## Links

- npm: https://www.npmjs.com/package/@hooks/interval
- npm.io page: https://npm.io/package/@hooks/interval

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2020-04-28
- 0.0.3 — 2020-03-08
- 0.0.2 — 2020-03-08
- 0.0.1 — 2020-03-08

## README

# 🎒 @hooks/interval

React hook to wrap setInterval

![NPM version](https://img.shields.io/npm/v/@hooks/interval?style=flat-square)
![Travis](https://img.shields.io/travis/com/simmo/hooks?style=flat-square)
![License](https://img.shields.io/npm/l/@hooks/interval?style=flat-square)

## Install

```bash
npm i @hooks/interval
```

## Usage

### useInterval

```ts
useInterval(callback: Function, interval?: number | null): void
```

#### Parameters

##### `callback: Function`

Will be executed each time the `interval` elapses.

##### `interval?: number | null`

Length of time in milliseconds before the `callback` is executed. Providing `null` will clear the interval.

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