typescript has been kicking my ass the past 24 hours :evaporate:

Follow

@alas @vaporeon_ what I am doing is taking two functions that take the same list of arguments and "concatenating" into one function

The new function takes a list of arguments, passes them to the given functions, and returns a list of return values from each input

I want typescript to make this all Just Work. I want it to implicitly understand the type of the new function.

it does seem to work, now. probably

@alas @vaporeon_ In javascript concatTasks is just

const concatTasks = (...tasks) => (meta, ...args) => tasks.map((fn) => fn(meta, ...args))

But to get the magic type inference in TypeScript I have to write

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.