Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Enrich data using ES2016 async/await
async function get(type) {
const rottentomatoesResponse = await fetch(`${type}`)
const json = await rottentomatoesResponse.json()
const titles = => {
return {
url: element.url,
title: element.title.split(':')[0]
return await Promise.all( => getImageFrom(title)))
async function getImageFrom({ title }) {
const tvmazeResponse = await fetch(`${title}`)
const json = await tvmazeResponse.json()
return {
img: json.image,
get("new").then(resp => {console.log("enriched data", resp)})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.