I have some trouble understanding how the ‘timeline’ or execution of blocks works.
My precise problem is that I use one Button which has 2 functions inside.
- function: upload some images to cloudinary and get their urls
- function: create a new object with some info and these image urls and upload them into a database (webapi)
Now, I noticed that sometimes the urls from function 1 make it into the database in function 2 and sometimes not. I added some random points in the code where it waits for a second or two. That increased the chance of landing in the database but it does not always happen.
So in general I thought one block is executed after the one before. So function 1 should finish before function 2 right? Is that that always the case? If no, when not and where can I learn about it?
A second question regarding this: if I WANT things to happen simultaniously, how do I do this? eg I want a sound recording of 5 seconds. (the recording block lets my do this). But I also want a timer to run for 5 seconds at the same time to show the user how much time he has left. So far my timer shows the 5 seconds and THEN the recording starts
A bit lost on the topic. Any source or info would help