Skip to content

Commit

Permalink
feat: 🎸 add useNumber alias
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Oct 29, 2018
1 parent 395e82b commit a58a4a7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
- [`useObservable`](./docs/useObservable.md) — tracks latest value of an `Observable`.
- [`useSetState`](./docs/useSetState.md) — creates `setState` method which works like `this.setState`. [![][img-demo]](https://codesandbox.io/s/n75zqn1xp0)
- [`useToggle` and `useBoolean`](./docs/useToggle.md) — tracks state of a boolean.
- [`useCounter`](./docs/useCounter.md) — tracks state of a number.
- [`useCounter` as `useNumber`](./docs/useCounter.md) — tracks state of a number.
- [`useList`](./docs/useList.md) — tracks state of an array.
- [`useMap`](./docs/useMap.md) — tracks state of an object.
<br/>
Expand Down
2 changes: 2 additions & 0 deletions docs/useCounter.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

React state hook that tracks a numeric value.

`useNumber` is an alias for `useCounter`.


## Usage

Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import useMediaDevices from './useMediaDevices';
import useMotion from './useMotion';
import useMount from './useMount';
import useNetwork from './useNetwork';
import useNumber from './useNumber';
import useObservable from './useObservable';
import useOrientation from './useOrientation';
import useRaf from './useRaf';
Expand Down Expand Up @@ -60,6 +61,7 @@ export {
useMotion,
useMount,
useNetwork,
useNumber,
useObservable,
useOrientation,
useRaf,
Expand Down
3 changes: 3 additions & 0 deletions src/useNumber.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import useNumber from './useCounter';

export default useNumber;

0 comments on commit a58a4a7

Please sign in to comment.