Skip to content

Instantly share code, notes, and snippets.

@malavsoni
Last active May 3, 2020 15:32
Show Gist options
  • Save malavsoni/b52bb39b4b21a229b3a49c0ff821adb5 to your computer and use it in GitHub Desktop.
Save malavsoni/b52bb39b4b21a229b3a49c0ff821adb5 to your computer and use it in GitHub Desktop.
const produceData = () => {
getData()
.then(result1 => processResult1(result1))
.then(result2 => processResult2(result2))
.then(result3 => return(result3))
.catch (error) => {
return error
}
}
// Produce and Return Data
produceData()
.then(data => sendToClient(data))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment