4 ms·
You might try replacing Lodash with Ramda. You have to get your head around “partial function application” (if you haven’t already), at which point all the bit
by Roboprog 8y ago
You might try replacing Lodash with Ramda. You have to get your head around “partial function application” (if you haven’t already), at which point all the bits for processing arrays and associative arrays via FP techniques really starts to gel.
E.g. - https://ramdajs.com/docs/#find https://ramdajs.com/docs/#find
Var find_default = R.find( R.prop( ‘default’ ) )
Var list = [
{ name: ‘Abe’, default: false },
{ name: ‘Bob’, default: true },
{ name: ‘Chuck’ }
]
Find_default( list )
//. -> { name: ‘Bob’, default: true }
(Apologies for gratuitous caps and periods my iPad is forcing in)