twilson63 / permaweb-cookbook

The Permaweb Cookbook is meant to house small digestible code snippets for someone that has no experience with blockchain or Permaweb to be able to grab and go.
https://cookbook.arweave.dev
57 stars 48 forks source link

Update http-api.md #263

Closed rosmcmahon closed 1 year ago

rosmcmahon commented 1 year ago

i think mixing then and async/await style promise handling is not right. pick one.

p.s. IMO if you pick then, you are wrong 😅

rosmcmahon commented 1 year ago

the one-liner version of async/await would be:

const result = await (await fetch('https://arweave.net/tx/EiRSQExb5HvSynpn0S7_dDnwcws1AJMxoYx4x7nWoho/status')).json()
console.log(JSON.stringify(result))

i think the double await would also look confusing for some