Could use some feedback: https://zelite.github.io/Twitch.tv-App/
I went around in circles trying to find a way to wait for all ajax calls to finish before starting to build the table.
I first make a call for “users” and then for “streams” and then I build the table.
I ended up making objects to store each user data, which doesn’t care in which order the users or streams calls end up finishing. And then I use
$(document).ajaxStop(populatePage) to finnaly add everything to the page. Maybe by trying to make it in a smart way, I ended up creating a spagethi monster xD Perhaps a simple chain of callbacks for each user would have been better.
Here’s the code: https://github.com/zelite/Twitch.tv-App
All feedback is welcome