Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercise #19

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Exercise #19

wants to merge 13 commits into from

Conversation

DanGRT
Copy link

@DanGRT DanGRT commented Sep 17, 2018

I like the apiRequests object and attached methods, think it will make it easy to add new functionality

<title>Responsive News Reader</title>
</head>

<body>
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good to have indentation used here. It will make the HTML structure easier to read

//TODO: stylization, excludeDomains/blocklist

//Object contains possible URLS for fetch requests
const apiRequests = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Very nice. I like how you have created an object that encapsulates all URL generation logic in one place

},

openCloseAdvanced: event => {
advancedSearchMenu.style.display === "none"
Copy link
Contributor

Choose a reason for hiding this comment

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

This could rewritten slightly cleaner as
advancedSearchMenu.style.display = advancedSearchMenu.style.display === "none ? = "block" : "none"


//creates each story panel from fetch response
function createStoryPanel(article){
const storyDivElement = assignElement("div", "story-div-element")
Copy link
Contributor

Choose a reason for hiding this comment

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

The logic here would be easier to implement as an HTML string template



function fetchNews(apiAddress){
fetch(apiAddress)
Copy link
Contributor

Choose a reason for hiding this comment

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

nice. good to see how you pass in url as param and implement display logic in own function

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.

None yet

2 participants