I have the following Lodash function
flow(find({ id: args.roleRateId }), get('chargeRate'))(
args.roleRates
)
however, it doesn't work for what i need, inside the get i need to add get('chargeRate', args.roleRate)
so it can get the chargeRate
form the args.roleRate
, but when i add this I do get Uncaught TypeError: Expected a function
Anyone has any ideea why is that and how to fix it?
First you import import get from 'lodash/get'
.
Then args.roleRate.chargeState
would be got like get(args.roleRate, 'chargeState')
or get(args, 'roleRate.chargeState')
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.