Possibly rename useSelectionState
to something more generic like useToggleList
or useArraySubset
#66
Labels
useSelectionState
to something more generic like useToggleList
or useArraySubset
#66
In forklift-ui, we use
useSelectionState
for both checkbox selections and row expansions in tables because the state requirements are exactly the same. However, the functions returned from this hook are named very specifically for selection, so it might be nice to make them more generic (toggleItem
,isItemToggled
,toggleAll
etc) and avoid confusing renames in destructuring like this one:We could then create thin wrappers with specific naming if we want, like
useSelectionState
,useExpansionState
, etc. Or we could have these functions returned in an array so they can be named on the fly, but there are so many...The text was updated successfully, but these errors were encountered: