Skip to content

Conversation

@jay9044
Copy link

@jay9044 jay9044 commented Sep 17, 2018

Challenging project.... I need to work on callbacks

.then(body => {
const topUsaNewsArticles = body.articles
return topUsaNewsArticles.map(article => {
topStoryDiv.innerHTML = "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might easier to generate using HTML strings

.then(body => {
const topUsaNewsArticles = body.articles
return topUsaNewsArticles.map(article => {
topStoryDiv.innerHTML = "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it would be good to see display logic extracted out to own function so it could re-used later if needed

@dmitrigrabov
Copy link
Contributor

Good work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants