-
Notifications
You must be signed in to change notification settings - Fork 280
Conversation
profxed
left a comment
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.
Hi @marwanaboudaoud, I can't say anything until I see some changes you make, because the review at the end not for us it's only for you and make you better with what you are doing.
I see your hard work And you may be so trust in your code but I don't see any progress if you didn't submit it by improve that thing is wrong for me...
Overall you have a very nice homework but you should follow our comments! 🙂
homework/src/index.js
Outdated
| reject(new Error(`Network error: ${xhr.status} - ${xhr.statusText}`)); | ||
| } | ||
| }; | ||
| xhr.onerror = () => cb(new Error('Network request failed')); |
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.
what is cb ?
| const select = createAndAppend('select', header, { class: "chose" }); | ||
| const table = createAndAppend('table', div, { class: 'font' }); | ||
| const tablebody = createAndAppend('tbody', table); | ||
| const title = createAndAppend('a', tablebody); |
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 line has two comments in a previous homeworks, it's nice to see some progress...
| }); | ||
|
|
||
|
|
||
| select.addEventListener('change', (event) => { |
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.
same as week2 comment
| title.innerHTML = "Repository: " + repository.name; | ||
| titleFork.innerHTML = "Forks: " + repository.forks; | ||
| descripTitle.innerHTML = "Description: " + repository.description; | ||
| newTitle.innerHTML = "Updated: " + new Date(repository.updated_at).toLocaleString(); |
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.
same as week2 comment('s)
| }); | ||
| } | ||
|
|
||
| catch (error) { |
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 using of catch ❤️
homework/src/index.js
Outdated
| contributors.forEach(contributor => { | ||
| const avatar = createAndAppend('img', container, { class: 'avatar' }); | ||
| avatar.setAttribute("src", contributor.avatar_url); | ||
| const list = createAndAppend('ul', container, { class: 'list' }); |
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.
Same as week2 comment
| color: red; | ||
| } | ||
|
|
||
| * { |
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.
Same as week2 comment
|
hello @JawharBairakdar |
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.
Hey @marwanaboudaoud I see that you changed some of this homework, and reviewed as requested.
So the changes has been made here so far are:
- some CSS styling
- removing the
cbfrom line 17 which is not the solution for handling errors in aPromisefunction.
What we still have:
- still need some changes from the CSS part.
- the HTML tag order.
- the Initial rendering.
How ever I am Not going to ask for any further changes and I will just approve it because As I said it's for you at the end 🙂
| } | ||
| }; | ||
| xhr.onerror = () => cb(new Error('Network request failed')); | ||
| xhr.onerror = () => (new Error('Network request failed')); |
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.
You are not doing any thing with the error in this case.
what you could do is to reject the error to make it available for the catch method, with that you can handle your error to show the user any information accords and happening.
- if it's an error so you did reject it.
- if not you resolved it.
No description provided.