Last active
December 5, 2017 20:36
-
-
Save rmoskal/8125eed0b04a4fccc9ad37274e8d4cd7 to your computer and use it in GitHub Desktop.
async_harmful_s3
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
function functionalWay2() { | |
fetch('blue') | |
.then(JSON.parse) | |
.then(_in =>{ | |
console.log(_in) | |
return transformFirst(_in)}) | |
.then(sendToClient) | |
.then(sendResults => remotelog('log',sendResults)) | |
.catch(err => remotelog('error', err)) | |
} | |
async function declarativeWay() { | |
try { | |
let resultsString = await fetch('blue') | |
let jsonResults=JSON.parse(resultsString) | |
console.log(jsonResults) | |
let transformResults= transformFirst(jsonResults) | |
let sendResults = await sendToClient(transformResults) | |
remotelog('log', sendResults) | |
}catch (e) { | |
remotelog('error', e) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment