• K6_696398
  • 663.1KB
  • zip
  • 0
  • VIP专享
  • 0
  • 2022-04-25 21:02
:pushpin: 目录 缺少特定功能? 贡献 执照 :construction_worker: 安装 含纱 yarn add use-selected-items-hook 使用NPM npm install use-selected-items-hook :pushpin: 转到示例 :laptop: 原料药 初始化 要初始化items数组,必须将initialItems作为参数传递。 也可以使用isSelected状态初始化项目,但要这样做,必须提供initialSelectedItems参数。 返回值 selectedItems :当前选定的项目。 listItems :状态为isSelected的项目。 请参阅用法。 动作 toggleSingleItem toggleAllItems :hammer: 建物 es (EcmaScript模块) cjs (CommonJS) :postbox: 常问问题 问题:该项目使用了哪些技术? 答:这个项目中使用的技术和
<p align="center"> <img src="" width="400"/> </p> [![Author](]( [![Languages](](#) [![Stars](]( [![Forks](]( [![Contributors](]( [![NPM](]( --- <p align="center"> <img src="" width="500"/> </p> <p align="center"> <a href="" rel='nofollow' onclick='return false;'>Check out the example</a> </p> --- # :pushpin: Table of Contents * [Installation](#construction_worker-installation) * [Usage](#pushpin-usage) * [API](#computer-api) * [Builds](#hammer-builds) * [FAQ](#postbox-faq) * [Found a bug? Missing a specific feature?](#bug-issues) * [Contributing](#tada-contributing) * [License](#closed_book-license) # :construction_worker: Installation ### With Yarn ```bash yarn add use-selected-items-hook ``` ### With NPM ```bash npm install use-selected-items-hook ``` # :pushpin: [Go to example](./example/pages/index.tsx) # :computer: 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](#pushpin-usage). --- ## Actions - ``toggleSingleItem`` - ``toggleAllItems`` # :hammer: Builds - `es` (EcmaScript module) - `cjs` (CommonJS) # :postbox: 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. # :bug: 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. # :tada: Contributing Check out the [contributing]( page to see the best places to file issues, start discussions and begin contributing. # :closed_book: License Released in 2020 This project is under the [MIT license]( Made with love by [Laura Beatris]( 💜🚀