Last active
February 4, 2022 04:29
-
-
Save lionxcr/358887da4e4ef026d90ece0ab460064c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dbConnection = new Promise((resolve, reject) => setTimeout(() => resolve(true), 500)) | |
const myFunction = async (req, res) => { | |
try { | |
const result = await dbConnection(); | |
// do something with result | |
} catch (e) { | |
console.error(e) | |
} | |
} | |
module.exports = async (req, res) => { | |
blah blah | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment