Consider this:
function doIt(thing: SomeThing, iterations: number): void {
// ...
}
class ThingProcessor{
private state: {
// how to avoid specifying the arguments again?
action: (thing: SomeThing, iterations: number) => void
};
}
In this example, I have to specify the doIt
function parameters twice. I'd rather indicate that state.action
is typeof(doIt)
, e.g. use the same signature as the doIt
function.