Run GetShowsAsync in the background
This allows for faster startup because initializing and checking the cache doesn't block the UI thread.pull/57/head
parent
9ac4b5643b
commit
4ae65e91df
|
@ -49,7 +49,9 @@ public class DiscoverViewModel : BaseViewModel
|
|||
|
||||
private async Task FetchAsync()
|
||||
{
|
||||
var podcastsModels = await showsService.GetShowsAsync();
|
||||
// run GetShowsAsync in the background, so things get initialized in the background
|
||||
// like checking the cache and the web request
|
||||
var podcastsModels = await Task.Run(() => showsService.GetShowsAsync());
|
||||
|
||||
if (podcastsModels == null)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue