Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
that's my status, over

Théo champion theochampion

💭
that's my status, over
View GitHub Profile
@theochampion
theochampion / asyncEnrich.js
Created Feb 23, 2018
Enrich data using ES2016 async/await
View asyncEnrich.js
async function get(type) {
const rottentomatoesResponse = await fetch(`https://www.rottentomatoes.com/api/private/v2.0/browse?sortBy=popularity&type=${type}`)
const json = await rottentomatoesResponse.json()
const titles = json.results.map(element => {
return {
url: element.url,
title: element.title.split(':')[0]
}
});
You can’t perform that action at this time.