Prefer WhenActivated over IDisposable
worldbeater opened this issue · 2 comments
worldbeater commented
ReactiveUI guidelines recommend using WhenActivated
to control the lifecycle of a ViewModel.
Let's prefer it over bare metal IDisposable
s.
WhenActivated is a way to track disposables. Besides that, it can be used to defer the setup of a ViewModel until it's truly required. WhenActivated also gives us an ability to start or stop reacting to hot observables, like a background task that periodically pings a network endpoint or an observable updating users current location.
Docs: https://reactiveui.net/docs/handbook/when-activated/
AvaloniaUI/Avalonia#1951
x2bool commented
Done!
worldbeater commented
❤