I'm using a function that extracts data from a GitHub repository. It returns an object with metrics like the number of closed issues, etc. This function is passed as a parameter of another function that stores these metrics in a database.
store(extract());
The problem is that the extract function is asynchronous (and for some reason, it needs to be asynchronous) and is not returning values... I don't know how to manage async very well. How I force store() to wait for extract() return the metrics?
Thanks in advance.
extractproduces or makestoreasynchronous as well and useawait. Which is basically the same thing, anyway, asawaitis still using the Promise.How I force store() to wait for extract() return the metrics?-->store(await extract())if the containing function is async