Guys, i would like to solve one issue with this async function. How to load output from that function to a variable usable in later non-async code? Like lets say i collect data from couple of APIs within async function, then i need to do some logic on top of that data with non-async code.
You can pass an objetc to the function, and then take care to only change the content of the object without making a copy of it, then what is passed is the address of the object. And when you modify it with methods of the object that don't make copies, you will be modifying the object itself outside the scope of the function.
I imagine that you already solved this but since I haven't seen anybody ever give you an answer I am posting this to help others with the same problem.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Guys, i would like to solve one issue with this async function. How to load output from that function to a variable usable in later non-async code? Like lets say i collect data from couple of APIs within async function, then i need to do some logic on top of that data with non-async code.
You can pass an objetc to the function, and then take care to only change the content of the object without making a copy of it, then what is passed is the address of the object. And when you modify it with methods of the object that don't make copies, you will be modifying the object itself outside the scope of the function.
I imagine that you already solved this but since I haven't seen anybody ever give you an answer I am posting this to help others with the same problem.