Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

migrating function to typescript from JS

I am implementing a working JS function to typescript, but I'm getting an error on parameters: "error, success"

[tslint] Parentheses are required around the parameters of an arrow function definition (arrow-parens)

function chapa() {
  console.log('altered');
  TouchID.isSupported()
  .then(authenticate)
  .catch(error => {
    AlertIOS.alert('TouchID not supported');
  });
}

so the "error" is underlined with error, with this message:

[tslint] Parentheses are required around the parameters of an arrow function definition (arrow-parens)

how should I pass then the "error" parameter?, cheers

like image 775
manuelBetancurt Avatar asked Jan 29 '23 09:01

manuelBetancurt


1 Answers

Just as it says, put parentheses around the parameter:

.catch((error: any) => {

like image 147
CertainPerformance Avatar answered Jan 31 '23 07:01

CertainPerformance