Skip to content

Instantly share code, notes, and snippets.

@munierujp
Last active December 27, 2020 06:55
Show Gist options
  • Save munierujp/c1e5349eb6b67913974354ac3105c061 to your computer and use it in GitHub Desktop.
Save munierujp/c1e5349eb6b67913974354ac3105c061 to your computer and use it in GitHub Desktop.
function tryEscape (escape) {
return new Promise((resolve, reject) => {
try {
const result = escape()
resolve(result)
} catch (e) {
reject(e)
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment