Skip to content

Instantly share code, notes, and snippets.

@kellyrmilligan
Created August 22, 2017 17:00
Show Gist options
  • Save kellyrmilligan/7d871961262a35cfea6779298f224d37 to your computer and use it in GitHub Desktop.
Save kellyrmilligan/7d871961262a35cfea6779298f224d37 to your computer and use it in GitHub Desktop.
multiple calls from a result - no caching
[{
id: 1234,
title: 'test',
view: 'two-column'
},
{
id: 1234,
title: 'test',
view: 'image-only'
}]
.forEach((article) => {
fetch(`/api/articles/${article.id}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
credentials: 'same-origin'
})
.then(response => response.json())
.then(articleDetails => article.details = articleDetails)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment