allTasks.reduce((acc, item) => { acc[item.label] = t => t.item.label === item.label; return acc; }, {} as Record boolean>)
tasks.reduce boolean>>((acc, item) => ..., {})Also imo it's cleaner to reduce to an object with something like this as the callback:(acc, item) => ({ ...acc, [item.label]: t => t.label === item.label })
Also imo it's cleaner to reduce to an object with something like this as the callback:
(acc, item) => ({ ...acc, [item.label]: t => t.label === item.label })
reply
allTasks.reduce((acc, item) => { acc[item.label] = t => t.item.label === item.label; return acc; }, {} as Record boolean>)