okaselect
v0.1.0
Published
![Main](https://github.com/miyanokomiya/okaselect/workflows/Main/badge.svg) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Downloads
53
Readme
okaselect
This is a convenient tool for the features of selecting.
You can select your items with some petterns: ctrl-select, multi-select, all-select and so on by this tool.
usage
yarn add okaselect
import { useSelectable } from 'okaselect'
const items = { a: {}, b: {}, c: {} }
const selectable = useSelectable(() => items)
// single select
selectable.select('a')
console.log(selectable.getSelectedIds()) // => ['a']
selectable.select('b')
console.log(selectable.getSelectedIds()) // => ['b']
// ctrl select
selectable.select('c', true)
console.log(selectable.getSelectedIds()) // => ['b', 'c']
console.log(selectable.getLastSelectedId()) // => 'c'
commnad
# install dependencies
$ yarn install
# lint
$ yarn lint
# test
$ yarn test [--watch]
# build
$ yarn build
publish
Create new release on Github.