0.1.6 • Published 2 years ago

@onehook/count v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

One hook : useCount

React hook for count state. Increment and decrement methods.

Instalation

yarn add @onehook/count

Usage

import useCount from '@onehook/count';

const { count, increment, decrement, reset, setCount, canIncrement, canDecrement } = useCount({
  initialValue: 2,
  max: 10,
  min: 0,
  step: 2,
});