Remix.run Logo
Waterluvian a day ago

I don’t like how dang busy it gets. What I do is if I need more than a few args, I accept only an object. And offer only type information in the signature, and resolve default values at the start of the function. It even works nicely if all args are optional.

Izkata a day ago | parent | next [-]

They are passing "prefix", "ending", and "extraNames" in an object. It's just defined inline in the function and using destructuring so the function can access the keys by name without having to put the object in a variable (and the default values are part of the object destructuring).

Waterluvian a day ago | parent [-]

Yeah but to have half-decent typings you then have to define the entire type, again, in the signature.

game_the0ry a day ago | parent | prev [-]

^^ this

I would probably do the same before using kwargs.