Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
AllenII16178y@GinjaNinja well I'm tired, and tired of looking at it myself. But criticism doesn't hirt me, and you're right when you say this isn't SO--precisely why i see no problem with asking you to elaborate. I'm all for learning better
-
AllenII16178y@rtannerf i definitely agree with the }))), i don't like seeing it either.
The recursion was very much accidental. I meant to put cb() but typed isDone() in my inattentiveness without even noticing.
getUsers() is using JSONP to query the twitch.tv api. Once all users were fetched, another function goes off to get additional info; i wanted an explicit way to run a callback once getUsers() was done (hence the name) instead of relying on getUsers() to always be faster.
Anywho, what name would you prefer as opposed to isDone ? And i formatted my shit better since taking the screenshot -
AllenII16178y@GinjaNinja i know promises a bit, but thanks for the suggestion because i didn't think of that. But i understand that promises are for a single request and response--is there some way that you know of that a promise can wait on several requests to finish? That would be an observable, wouldn't it? Just asking for future endeavours.
-
What @rtannerf said! 😎 You will certainly be able to find and accomplish what you need with Promise.all() and Array.map().
Good luck and happy learning!
Was wondering why my callback wouldn't run when I intended.
> console.log each iteration
> realizes it skips the goal and goes up one
> decided to cheat use greater than instead
> ACCIDENTAL RECURSION
> Oh, there's the problem
> Thinks about going to bed for the night
undefined
i probably won't
are there pills for attention?