-
Notifications
You must be signed in to change notification settings - Fork 34
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
base: master
Are you sure you want to change the base?
Exercise #19
Conversation
<title>Responsive News Reader</title> | ||
</head> | ||
|
||
<body> |
There was a problem hiding this comment.
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 = { |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
I like the apiRequests object and attached methods, think it will make it easy to add new functionality