Are these two snippets the same?
The top version returns a promise in the arrow function, and the bottom one doesn't return anything. Is there an implicit return when using async, should I return null, do I need to return the const info?
When i look at how babel translates them it replaces async/await with generators that make it look like i should return the const info
// t.get() is a promise, set and delete are not
db.runTransaction(t => {
return t.get(infoRef).then(info => {
t.set(db.doc(`/users/${uid}`), info.data());
t.delete(infoRef);
});
});
db.runTransaction(async t => {
const info = await info.get(infoRef)
t.set(db.doc(`/users/${uid}`), info.data());
t.delete(infoRef);
});