Last active
September 22, 2020 17:38
-
-
Save cmonacaps/63cab833012a80c66fc9192d42783020 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 ax = require('axios') | |
const f = require('./requesterFunction') | |
const input = { | |
type: 'Dish', | |
id: 'f9abece6-10d6-4f49-8297-ae2fe6e07550', | |
data: { | |
name: 'cheese slice', | |
size: 'yield sign', | |
price: '5.50' | |
} | |
} | |
Promise.resolve( | |
f(input) | |
).then( | |
({status, content}) => { | |
console.log({status, content}) // note probably good return type on these functions. | |
} | |
).catch( | |
err => { | |
console.log(err.status, err.message) // i.e. convertable to HttpResponse | |
console.error(err) // also dump stack trace if worthwhile | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment