Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kirkshoop/6464689 to your computer and use it in GitHub Desktop.
Save kirkshoop/6464689 to your computer and use it in GitHub Desktop.
ReactiveCommand async registration and subscription
from(enable->RegisterAsyncFunction(
[](RoutedEventPattern)
{
// background thread
// enable and disable commands will be disabled until this is finished
std::this_thread::sleep_for(std::chrono::seconds(2));
return true;
})) // this is a subscription to the enable ReactiveCommand
// back on the ui thread
.subscribe([this](bool) // takes whatever was returned above
{
// update the ui
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment