I have a function stored in a variable that I want to pass to another function and have it reuse its parameters. However, this is not working as expected. Take a look at the examples below:
// Attempting to pass a function and steal its parameters dynamically
const a = (a: string) => { }
const b = (...args: Parameters<typeof a>) {
}
const c = (c) => (...args: Parameters<typeof c>) => {
}
const d = <T>(...args: Parameters<T>) => {
}
// This works:
b()
// This does not work; need to find a solution
c(a)()
// This works, but it's not an ideal solution due to its length
d<typeof a>(1)
// In a real-world scenario, the last solution would be something like this
Foo.make<typeof Some.Function.GetIt>(Some.Function.GetIt, ...)