I want to dispatch a job to the UI thread, then wait for the result and use it from another thread. Like this, but co_await does not work inside the lambda:
dispatcher.RunAsync(CoreDispatcherPriority::Normal, [&]() {
auto res = co_await mStoreContext.RequestPurchaseAsync(L"");
});
Or even waiting for the whole RunAsync operation, if I could get my result out from it
co_await resume_foreground(dispatcher); auto res = co_await mStoreContext.RequestPurchaseAsync(L""); co_await resume_background(); use_result(res);