Hey Campers!
Just finished my TwitchTv Project.
I would love to hear some feedback for the same!
Here’s the Twitch Project Link.
Edit Reason: Project LInk changed.
@kharatpriyank - How many users should I expect to see by clicking All? You have an array called USERS, so I expected to see 8 users, but the most I ever see is 2. Also, if I click Offline, I only see one, when I know there should be several more users which are offline (like FreeCodeCamp). I have not reviewed your code in detail, but I think you have some debugging to do to make it at least show the 8 users (whether or not they are online or offline).
UPDATE #1: If I run the app different times, I will see anywhere from 2 to 7 users show in the All, so you definitely have some issues to work out.
UPDATE #2: The following code is why things are not working correctly.
if (i === USERS.length - 1) {
// emit complete event.
newThis.makeUi();
}
Because $.ajax is asynchronous, the value of i will not necessarily be in sequence. There is a very simple way to change the code above to make it work. You just need to replace i with a value which you know contains the same value as USERS.length - 1. If you think about it for a moment, I think you will know how to get it.
if (???? === USERS.length - 1) {
// emit complete event.
newThis.makeUi();
}
#Updlate1 : Thanks for the feedback! I will definitely fix the issue.
#Udpade 2: I think I have fixed the issue, I see 8 cards for All tab, and online/offline ones for their respective active tabs. All I had to do was :
if( dataResponses.length === USERS.length){
//emit complete event
newThis.makeUi();
}
Again, Thank You so much , Still if something’s wrong, please let me know.
Yes, that is all you had to do.
Hey,
The project looks good, my main feedback would be that everything seems quite large. i.e. when I first open the page I can only see the info for one stream and have to scroll quite a lot to see all the stream details. Have you thought about making the logos slightly smaller so a viewer can see more info when they first land?
Thank you for the feedback Pagey. I thought about that, but there are only 8 users and not a lot of info to show regarding each user. I can easily make the user’s logo smaller, but I personally liked the large logo version. If it comes under bad design principles, I will definitely make them smaller.