This is pretty cool. it was initially confusing as I didn’t understand the concept of promises, but this video (on roblox
) did a great job of abstracting out the concept of promises.
I do have a few follow up questions:
And I’m also asking this while looking at the github for promises referenced on the external libraries section of the “Scripting in Lua” reference so if you don’t feel like answering it, I’ll see if I can answer it myself after reading:
- Should I always call resolve && reject with a promise or should I call what I’m expecting the promise to do?
- Can I provide any type and amount of arguments / parameters to resolve / reject?
- What actually happens when something is resolved or rejected. Does the data in the parenthesis get passed or something?
It’s a bit more clear, but not all there…I’ll keep studying regardless. Thanks this much for the detailed explanation - it’s appreciated!