use-array

1.0.0 • Public • Published

NPM

use-array

A custom React hook that lets you manipulate an array data structure without ever needing extra utilities.

👉 Demo site and docs.

Start with:

npm install --save use-array

Then, import and use the hook:

import useArray from 'use-array'
// …in your functional component:
const [ list, {
  set, empty, replace, push,
  updateAt, setAt, removeAt,
  filter, map, sort, reverse,
  mergeBefore, mergeAfter,
}] = useArray(defaultList);

Docs

The complete documentation as well as a live demo is available here.

License

MIT © filipdanic

Readme

Keywords

none

Package Sidebar

Install

npm i use-array

Weekly Downloads

21

Version

1.0.0

License

MIT

Unpacked Size

16.1 kB

Total Files

7

Last publish

Collaborators

  • filipdanic