# react-cool-timer

> React timer countdown hook

Latest version **1.0.1** (published 2023-04-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-cool-timer
pnpm add react-cool-timer
yarn add react-cool-timer
bun add react-cool-timer
```

## 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.1 |
| Published | 2023-04-05 |
| First published | 2023-04-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mehdi Faraji |
| Maintainers | mehdifaraji |
| Keywords | react-native, react, nextjs, android, ios, mobile, countdown, timer, hook |

## Links

- npm: https://www.npmjs.com/package/react-cool-timer
- Repository: https://github.com/1mehdifaraji/react-cool-timer
- Homepage: https://github.com/1mehdifaraji/react-cool-timer#readme
- Issues: https://github.com/1mehdifaraji/react-cool-timer/issues
- npm.io page: https://npm.io/package/react-cool-timer

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

- 1.0.1 (latest) — 2023-04-05

## README

# react-cool-timer

React timer countdown hook with easy to use API .

### Installation

```sh
$ npm install --save react-cool-timer
```

or

```sh
yarn add react-cool-timer
```

or

```sh
pnpm add react-cool-timer
```

### Usage

```javascript
import { useTimer } from "react-cool-timer";

export const App = () => {
  const { timeLeft } = useTimer({
    onEndReached: () => console.log("Reached end"),
    timeInterval: 20,
  });
  return <div>Timeleft : {timeLeft}</div>;
};
```

## Available props

| Name         | Type         | Default      | Description                             |
| ------------ | ------------ | ------------ | --------------------------------------- |
| onEndReached | `() => void` | `null`       | Sets a function to run after timer ends |
| timeInterval | `number`     | **REQUIRED** | Sets time interval in seconds           |

## Developer

[@1mehdifaraji](https://github.com/1mehdifaraji)

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