Comment

Comment by flufluflufluffy

The type annotation gymnastics you sometimes have to do when reducing to an object in TypeScript are annoying.

allTasks.reduce((acc, item) => { acc[item.label] = t => t.item.label === item.label; return acc; }, {} as Record<string, (t: typeof tasks[number]) => boolean>)

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton