Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • use deasync like this stackoverflow.com/a/47051880/2083877 Commented Sep 8, 2021 at 11:26
  • 19
    @SunilKumar I don't think this is useful. OP made this question and self-answer to document how to get the response from async calls. Suggesting a 3rd party module defeats such purpose, and IMO the paradigm introduced by that module is not good practice. Commented Sep 10, 2021 at 9:14
  • 7
    @Liam: It's just an example for an asynchronous function that accepts a callback. Commented Oct 15, 2021 at 14:13
  • Promises provide a cleaner and more structured way to deal with asynchronous operations. You can create promise that represents the result of the asynchronous call. The promise can be resolved with the response or rejected with an error. Commented Jul 27, 2023 at 6:32