Allows for multi-key cached selection from Redux state
// OLD
const fields = [
"Name",
"Price",
"Itemized Receipt",
"CheckAlice",
"CheckBob",
"CheckEve",
"CheckMallory",
"CheckTrent",
"Meal",
"Tags"
].map((f: string) => `Dino::${f}`)
const fieldsData = fields
.map((key: string) => {
const value = simpleSelect(props.simpleForm, key, "data")
return { [key]: value }
})
.reduce((prev, current) => ({...prev, ...current}), {})
// New
const fields = [
"Name",
"Price",
"Itemized Receipt",
"CheckAlice",
"CheckBob",
"CheckEve",
"CheckMallory",
"CheckTrent",
"Meal",
"Tags"
].map((f: string) => `Dino::${f}.data`)
const fieldsData = simpleSelectorPick(props.simpleForm, fields)