Lifting App State with Geoffrey Huntley

Sign in to queue

The Discussion

  • User profile image
    ShardingKing

    Is the pattern of toggling IsBusy really a race condition? I thought this was a thread safe design in the UI world because you're forced to use the UI thread to make any changes that effect UI. 

  • User profile image
    modplug

    @ShardingKing:If you manipulate IsBusy from different places in your code it will become a potential problem. Imagine that you have 3 different functions / tasks that changes the IsBusy property. If two of them starts at the same time, one will finish first and trigger IsBusy = false. And thus the IsBusy property is not telling the truth considering only one of the tasks have finished. You can account for this by keeping local state in your viewmodel, but that's when you end up with alot of state which this library helps you avoid

  • User profile image
    ShardingKing

    @modplug:Thanks for the dialogue. I think the gotcha here was that the application allows more than 1 action to hold the busy state at the same time vs checking that the state isn't busy before allowing a command to run. In this scenario, reactive extension definitely makes it cleanly possible to do this. Thanks again.

  • User profile image
    misterfast1

    Eeeeezz

Add Your 2 Cents