i dont suppose ur an expert at javascript promises and love solving other ppls problems | |
# ¿ Feb 14, 2021 01:39 |
|
|
# ¿ May 10, 2024 16:42 |
hbag posted:my poo poo's more python, lua, and a tiny amount of bash tbh https://pastebin.com/JGs4kz4z here is my code im trying to call the 2 functions at the same time (so http requests go out at the same time), but function 2 shouldnt output its response unless function 1 is already finished running... the problem is, i have no idea how Promises work, and apparently i've just made it so function 2 doesnt get called at all until function 1 is done* *i feel bad already pls dont worry about my bugs** **unless... haha.... |
|
# ¿ Feb 14, 2021 02:28 |
hbag posted:i'll give this a look when i can get around to remembering poo poo about js, no promises though |
|
# ¿ Feb 14, 2021 02:54 |
cruft posted:Would it be okay if I showed you how to do this without jQuery? ! most definitely would be appreciated |
|
# ¿ Feb 14, 2021 03:31 |
GODSPEED JOHN GLENN posted:Hey nerds |
|
# ¿ Feb 14, 2021 03:33 |
cruft posted:Here you go, fellow nerd and vanilla js is always ftw :^} |
|
# ¿ Feb 14, 2021 18:16 |
|
|
# ¿ May 10, 2024 16:42 |
cruft posted:Yeah, async/await are neato. I don't use them all the time because they're a bit more limited, but in a lot of cases they're just fine and make your code a lot easier to follow. Here's two ways to do the same thing: got my 2 HTTP requests to start at the same time! which was my big goal lowkey surprised that they are actually getting processed in parallel, even though i supposedly know that PHP creates new threads or w/e for each new process ... man what a w00t day |
|
# ¿ Feb 14, 2021 22:12 |