# use-drunk-state

> Drop in replacement for `setState` that randomizes your stuff every three seconds. Ty @rickhanlonii.

Latest version **0.1.2** (published 2019-04-27) · 0 weekly downloads

## Install

```sh
npm install use-drunk-state
pnpm add use-drunk-state
yarn add use-drunk-state
bun add use-drunk-state
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2019-04-27 |
| First published | 2019-04-27 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 18.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | walaura |

## Links

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

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^16.8.6
- [react-dom](https://npm.io/package/react-dom.md) ^16.8.6
- [react-scripts](https://npm.io/package/react-scripts.md) 3.0.0

## Recent versions

- 0.1.2 (latest) — 2019-04-27
- 0.1.1 — 2019-04-27
- 0.1.0 — 2019-04-27

## README

# use-drunk-state

Drop in replacement for `setState` that randomizes your stuff every three seconds. Ty <a href="https://github.com/rickhanlonii">@rickhanlonii</a>.

<img width="1142" alt="Screenshot 2019-04-27 at 3 40 02 pm" src="https://user-images.githubusercontent.com/11539094/56850421-c5268d80-6902-11e9-95c9-604a058bf294.png">

```jsx
import { useDrunkState } from 'use-drunk-state';

function App() {
	const [thing, setThing] = useDrunkState(null);
	const [list, setList] = useDrunkState(['eggs', 'milk', 'test']);
	return (
		<div>
			<h1>Todos</h1>
			<ul>
				{list.map(item => (
					<li key={item}>{item}</li>
				))}
			</ul>
			<input
				type="text"
				value={thing}
				onChange={ev => {
					setThing(ev.target.value);
				}}
			/>
			<button
				onClick={() => {
					setList(list => [...list, thing]);
					setThing(null);
				}}
			>
				Add todo
			</button>
		</div>
	);
}
```

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