1 contributor
Like
Install group-by as a package?
Copied
npm i @bit/justin-capalbo.ramda.group-by
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example modifieddraft
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
and packages in Bit or NPM to the example. any of the 1 million componentstoggle layout
No preview available
chevron_left
chevron_right
groupBy (
fn:
Function
,list:
) : Array
Object
Splits a list into sub-lists stored in an object, based on the result of calling a String-returning function on each element, and grouping the results according to values returned.
Dispatches to the groupBy
method of the second argument, if present.
Acts as a transducer if a transformer is given in list position.
Example
Arguments
fn:
Function
Function :: a -> String
list:
Array
The array to group
Returns
Object
An object with the output of `fn` for keys, mapped to arrays of elements that produced that key when passed to `fn`.