# @tdukart/use-state-set

> React hook to more easily use Set in state

Latest version **0.1.1** (published 2023-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tdukart/use-state-set
pnpm add @tdukart/use-state-set
yarn add @tdukart/use-state-set
bun add @tdukart/use-state-set
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2023-10-17 |
| First published | 2023-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Todd Dukart |
| Maintainers | tdukart |

## Links

- npm: https://www.npmjs.com/package/@tdukart/use-state-set
- Repository: https://github.com/tdukart/use-state-set
- Homepage: https://github.com/tdukart/use-state-set#readme
- Issues: https://github.com/tdukart/use-state-set/issues
- npm.io page: https://npm.io/package/@tdukart/use-state-set

## Recent versions

- 0.1.1 (latest) — 2023-10-17
- 0.1.0 — 2023-10-17

## README

# use-state-set

A convenience React hook to use JS Sets in a React state.

## Usage

```jsx
import useStateSet from '@tdukart/use-state-set';

function Foo() {
  const [greetings, addGreeting, removeGreeting] = useStateSet(new Set(['hello']));

  return (
    <div>
      <ul>
        {Array.from(greetings).map(greeting => (
          <li key={greeting}>{greeting}</li>
        ))}
      </ul>
      <button onClick={() => addGreeting('hi')}>Add "hi"</button>
      <button onClick={() => removeGreeting('hello')}>Remove "hello"</button>
    </div>
  );
}
```

## Copyright/License

MIT licensed.

Copyright 2023 Todd Dukart.

---
_Source: https://npm.io/package/@tdukart/use-state-set · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
