My goal is to have a different function fired depending on a variable value. VS Code is giving me an error warning stating that:
'method' implicitly has a type of 'any' because 'type1Func' and 'type1Func' are strings and can't be used as an index. I am using a similar technique on a normal Vue js file successfully but I don't know how to resolve this in this typescript file.
func handleListeningDevice(name: NewNameOption) {
const method = !!name ? 'type1Func' : 'type2Func';
this[method]({
name: name ?? 'none',
});
}