This file contains hidden or 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 functionalWay(color) { | |
| fetch(color) | |
| .then(JSON.parse) | |
| .then(transformFirst) | |
| .then(sendToClient) | |
| .then(remote_log_wrapped('log')) | |
| .catch(remote_log_wrapped('error')) | |
| } | |
This file contains hidden or 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
| /** | |
| Takes this incoming array | |
| [ { team: 'blue', | |
| sales: 900, | |
| userId: 'a0bc44d0-da95-495d-bcf2-535d0b9d8af3', | |
| name: 'Sally Smith' }, | |
| { team: 'blue', | |
| sales: 800, | |
| userId: 'c509388c-9321-4fab-8062-3fa56b2b0d87', | |
| name: 'John Jones' } ] |
This file contains hidden or 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(color) { | |
| fetch(color) | |
| .then(JSON.parse) | |
| .then(transformFirst) | |
| .then(sendToClient) | |
| .then(sendResults => remotelog('log',sendResults)) | |
| .catch(err => remotelog('error', err)) | |
| } |
This file contains hidden or 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)) |
This file contains hidden or 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 inspect(_in) { | |
| console.log(_in) | |
| return _in | |
| } |
This file contains hidden or 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(color) { | |
| fetch(color) | |
| .then(inspect) | |
| .then(JSON.parse) | |
| .then(inspect) | |
| .then(transformFirst) | |
| .then(sendToClient) | |
| .then(sendResults => remotelog('log',sendResults)) | |
| .catch(err => remotelog('error', err)) | |
| } |
This file contains hidden or 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
| let Api_results= | |
| [ { team: 'blue', | |
| sales: 900, | |
| userId: 'a0bc44d0-da95-495d-bcf2-535d0b9d8af3', | |
| name: 'Sally Smith' }, | |
| { team: 'blue', | |
| sales: 800, | |
| userId: 'c509388c-9321-4fab-8062-3fa56b2b0d87', | |
| name: 'John Jones' } ] |