Skip to content

Commit

Permalink
Update README to add additional info
Browse files Browse the repository at this point in the history
  • Loading branch information
johndiiorio committed Feb 4, 2019
1 parent 092b6de commit b276486
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[![npm version](https://img.shields.io/npm/v/react-useinterval.svg?style=flat)](https://www.npmjs.com/package/react-useinterval) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/johndiiorio/react-useinterval/blob/master/LICENSE)

# react-useInterval
A custom React hook that wraps JavaScript's setInterval function.

## Install

Install with [npm](https://www.npmjs.com/):
Install with [npm](https://www.npmjs.com/) (or [yarn](https://yarnpkg.com/)):

```sh
$ npm install --save react-useinterval
Expand All @@ -9,7 +14,7 @@ $ npm install --save react-useinterval
## Example Usage

```js
import React, { useState, useEffect, useRef } from 'react';
import React, { useState } from 'react';
import useInterval from 'react-useinterval';

function Counter() {
Expand All @@ -22,4 +27,4 @@ function Counter() {
}
```
## Thanks
Inspired by Dan Abramov's blog post [here](https://overreacted.io/making-setinterval-declarative-with-react-hooks/).
Inspired by Dan Abramov's blog post [here](https://overreacted.io/making-setinterval-declarative-with-react-hooks/).

0 comments on commit b276486

Please sign in to comment.