Skip to content

useCounter

Category
Last Changed
3月6日6时49分

Basic counter with utility functions.

Demo

Count: 0

Basic Usage

js
import { useCounter } from 'comuse-core'

const { count, inc, dec, set, reset } = useCounter()

Usage with options

js
import { useCounter } from 'comuse-core'

const { count, inc, dec, set, reset } = useCounter(1, { min: 0, max: 16 })

Source

SourceDemoDocs

Changelog

v3.2.7 on 3/25/2025
8168c - feat: add useToggle

Released under the MIT License.