I have a array of objects that I pass through lodash chain to get the desired output.
But I want to make the code modular so instead of using _. I want to import the specific functions to reduce import size, I searched through lodash docs, but couldn't found anything useful.
import _ from 'lodash'
let TransactionList = _(TransactionData)
.groupBy('hash')
.map(_.spread(_.merge))
.value()
I tried this but this doesn't work either.
import { flow, groupBy, map, merge, spread } from 'lodash'
let TransactionList = flow(
groupBy('hash'),
map(spread(merge))
)(TransactionData)