'Is there a better way to write ".then(({x}) => {return x();});"? [closed]
I want to directly assign a variable to a method of a returned promise. I'm wondering if theres a cleaner looking solution to this?
const data = ( await db.collection('x').doc('y').get(); ).data();
const data = await db.collection('x').doc('y').get().then( ({data}) => { return data(); } );
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
