Skip to content

LauraBeatris/use-selected-items-hook

Repository files navigation

Author Languages Stars Forks Contributors NPM


Check out the example


📌 Table of Contents

👷 Installation

With Yarn

yarn add use-selected-items-hook

With NPM

npm install use-selected-items-hook

💻 API

Initialization

To initialize the items array, the initialItems must be passed as an argument. It's also possible to initialize the items already with an isSelected state, but to do so, it's necessary to provide the initialSelectedItems argument.


Return Values

  • selectedItems: The items that are currently selected.
  • listItems: The items with the status of isSelected. Refer to the Usage.

Actions

  • toggleSingleItem

  • toggleAllItems

🔨 Builds

  • es (EcmaScript module)
  • cjs (CommonJS)

📮 Faq

Question: What are the technologies used in this project?

Answer: The technologies and libraries used in this project are React + TypeScript and Immutability Helper to handle the array manipulation.

🐛 Issues

Feel free to file a new issue with a respective title and description on the the useSelectItems hook repository. If you already found a solution to your problem, I would love to review your pull request! Have a look at our contribution guidelines to find out about the coding standards.

🎉 Contributing

Check out the contributing page to see the best places to file issues, start discussions and begin contributing.

📕 License

Released in 2020

This project is under the MIT license.

Made with love by Laura Beatris 💜🚀