Skip to content

Commit

Permalink
Dat Threading
Browse files Browse the repository at this point in the history
  • Loading branch information
anaisbetts committed Sep 25, 2013
1 parent a2e3880 commit ab3b1de
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions AkavacheExplorer/ViewModels/CacheViewModel.cs
Expand Up @@ -52,10 +52,13 @@ public CacheViewModel(IScreen hostScreen, IAppState appState)
.ToProperty(this, x => x.UrlPathSegment);

Keys = new ReactiveList<string>();
appState.WhenAny(x => x.CurrentCache, x => x.Value).Subscribe(cache => {
Keys.Clear();
cache.GetAllKeys().ForEach(x => Keys.Add(x));
});
appState.WhenAny(x => x.CurrentCache, x => x.Value)
.SelectMany(x => Observable.Start(() => x.GetAllKeys(), RxApp.TaskpoolScheduler))
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(newKeys => {
Keys.Clear();
newKeys.ForEach(x => Keys.Add(x));
});

SelectedViewer = "Text";

Expand Down

0 comments on commit ab3b1de

Please sign in to comment.