Is it okay to use lodash inside a pure function to _.map
an input value or can I only use the native Array.map
which is slower?
For example:
let shortcuts = _.map(state.shortcuts, (shortcut: any) => {
switch(shortcut.page){
case "Transfers": return tassign(shortcut, { badge: action.payload.transfers });
case "Payments": return tassign(shortcut, { badge: action.payload.payments });
case "Inbox": return tassign(shortcut, { badge: action.payload.inbox });
case "ConsolidatedPosition": return tassign(shortcut, { badge: action.payload.consolidatedPosition });
default: return shortcut;
}
});
return tassign(state, { shortcuts: shortcuts });