I have a piece of code that returns a JQuery promise:
const jqProm = server.downloadAsync();
I wish to use it inside async function. I was hoping I could create something like C# TaskCompletionSource, return dummy Task (Promise) and as a handler for jqProm resolve/reject set the status of dummy Task (Promise).
How to do that? I can find only Promise constructor that takes in resolver and rejector actions - but there is no thing like PromiseCompletionSource.