Skip to content

useSet

jsxhook

useSet component

Installation

$ bunx termuijs add use-set

Copies the source into src/components/use-set/ and installs @termuijs/jsx.

Usage

ts
import { useSet } from '@termuijs/jsx'
ts
const { value, set, reset } = useSet({
  initial: undefined,
})

API Reference

useSet

PropTypeDefaultDescription
initialT | undefinedInitial value
persistbooleanfalsePersist to storage
keystringStorage key
#hook#use-set