ViewModel
public class MyViewModel:ReactiveObject, IRoutableViewModel{
private ReactiveList _appExtensions;
p
Can you show the implementation of _schemaService.GetApplicationExtensions()
?
Depending on how it is implemented it might not actually be on another thread. Arguably, ReactiveCommand should guarantee that even async operations that accidentally burn CPU before running an async op are forced onto background threads, but efficiency is trumping defensive programming in this case.
You shouldn't need either SubscribeOn
or ObserveOn
, ReactiveCommand already guarantees that values will be returned on the UI thread. Otherwise, this code is looking good!
Change
GetApplicationExtensions
.ObserveOn(RxApp.MainThreadScheduler)
.SubscribeOn(RxApp.TaskpoolScheduler)
to
GetApplicationExtensions
.SubscribeOn(RxApp.TaskpoolScheduler)
.ObserveOn(RxApp.MainThreadScheduler)
ObserveOn should be after SubscribeOn