Inside Login.js, line 18, there is a redundant async.
With asynchronous programming in JavaScript, promises handle asynchronous code with .then() and .catch(), while async/await is an alternative to promises. Also, with async functions. you expect an await somewhere inside...
async is, therefore, a function that returns a promise, and await synchronously executes an operation in a promise and wait for it to resolve
So, firebase.auth().signInWithPopup(provider).then(async function(result) { can be simplified to firebase.auth().signInWithPopup(provider).then(result => {.
Arrow functions in JavaScript remove the need for an explicit function definition.
Inside
Login.js
, line 18, there is a redundantasync
.With asynchronous programming in JavaScript, promises handle asynchronous code with
.then()
and.catch()
, whileasync/await
is an alternative to promises. Also, withasync
functions. you expect anawait
somewhere inside...async
is, therefore, a function that returns a promise, andawait
synchronously executes an operation in a promise and wait for it to resolveSo,
firebase.auth().signInWithPopup(provider).then(async function(result) {
can be simplified tofirebase.auth().signInWithPopup(provider).then(result => {
.Arrow functions in JavaScript remove the need for an explicit function definition.