Where to put the timer in the mvvm project that polls the feed

I have an MVVM project that polls a channel every 10 seconds to see updates. The result from the feed is displayed using the ObervableCollection. This works well, but I'm not sure where I can send my dispatcher. Should it be in Model.DataService or in ViewModel.MainViewModel?

thank

+3
source share
3 answers

I think that there is no right answer without knowing the details of the project.

Regarding the MVVM pattern:
Put it in Model.DataService)
Or is it a feature of your view? Yes => Put it in ViewModel.MainViewModel.

, ( )? , ViewModel.

0

, , ViewModel. ViewModel, ViewModel Observable.

0

Reactive Framework Observable.FromEvent. . (.Throttle(3000) 3- ), , .

0

Source: https://habr.com/ru/post/1751535/


All Articles