# use-array-state

> Provides a reducer to simplify handling of mutations to array state

Latest version **1.0.2** (published 2019-03-19) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-03-19 |
| First published | 2019-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 22 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Maintainers | azmenak |
| Keywords | react, hook, hooks, async, reducer, typescript, esm, pika, useArrayState, useReducer |

## Links

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

## Dependencies (1)

- [typesafe-actions](https://npm.io/package/typesafe-actions.md) ^3.2.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2019-03-19
- 1.0.1 — 2019-03-19

## README

# use-array-state

A simple helper to makes changes to an array without needing to worry about mutating the value

## Install

```
npm install use-array-state
```

## Useage

```ts
import useArrayState from 'use-array-state'

function ArrayComponent () {
  const [value, valueActions] = useArrayState()

  return (
    <div>
      <button onClick={() => {valueActions.push('new-value')}}
      <pre>
        {JSON.stringify(value, null, 2)}
      </pre>
    </div>
  )
}
```

## Available actions

See `src/index.ts` for the the interface, all methods contain docs in types

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