Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrow functions and async redundancy #2

Open
ghost opened this issue Jul 10, 2019 · 1 comment
Open

Arrow functions and async redundancy #2

ghost opened this issue Jul 10, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 10, 2019

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.

@TianJagodic
Copy link
Owner

Ok tnx. Do note that there are 3 branches currently. And that in the master stuff is broken...alot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant