File tree Expand file tree Collapse file tree 4 files changed +15
-30
lines changed
app/src/main/java/es/ffgiraldez/comicsearch Expand file tree Collapse file tree 4 files changed +15
-30
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ package es .ffgiraldez .comicsearch .rx ;
2+
3+ import es .ffgiraldez .comicsearch .ReplaceToVoid ;
4+ import rx .functions .Func1 ;
5+
6+ public class Replacements {
7+ public static Func1 <Object , Void > returnVoid () {
8+ return new ReplaceToVoid ();
9+ }
10+ }
Original file line number Diff line number Diff line change 1818
1919import java .util .List ;
2020
21- import es .ffgiraldez .comicsearch .ReplaceToVoid ;
2221import es .ffgiraldez .comicsearch .data .ComicStorage ;
2322import es .ffgiraldez .comicsearch .model .SearchResult ;
23+ import es .ffgiraldez .comicsearch .rx .Replacements ;
2424import es .ffgiraldez .comicsearch .search .domain .FetchSearchResultTransformer ;
2525import rx .Observable ;
2626
@@ -40,7 +40,7 @@ public void initialize() {
4040
4141 subscribe (Property .RESULTS , fetchResultObservable );
4242 Observable <List <String >> resultsObservable = observe (Property .RESULTS );
43- updatedResultsObservable = resultsObservable .map (new ReplaceToVoid < List < String >> ());
43+ updatedResultsObservable = resultsObservable .map (Replacements . returnVoid ());
4444 }
4545
4646 public Observable <Void > didUpdateResults () {
Original file line number Diff line number Diff line change 1919import java .util .List ;
2020import java .util .concurrent .TimeUnit ;
2121
22- import es .ffgiraldez .comicsearch .ReplaceToVoid ;
2322import es .ffgiraldez .comicsearch .data .ComicStorage ;
23+ import es .ffgiraldez .comicsearch .rx .Replacements ;
2424import es .ffgiraldez .comicsearch .sugestion .domain .FetchQueryTransformer ;
2525import rx .Observable ;
2626
@@ -32,6 +32,7 @@ public class SuggestionViewModel extends ObservableSuggestionViewModel {
3232 public SuggestionViewModel (ComicStorage comicStorage ) {
3333 this .comicStorage = comicStorage ;
3434 }
35+
3536 @ Override
3637 public void initialize () {
3738 Observable <String > input = this .<String >observe (Property .QUERY )
@@ -42,7 +43,7 @@ public void initialize() {
4243 subscribe (Property .SUGGESTIONS , suggestionObservable );
4344
4445 Observable <List <String >> suggestionPropObservable = observe (Property .SUGGESTIONS );
45- updatedSuggestionsObservable = suggestionPropObservable .map (new ReplaceToVoid < List < String >> ());
46+ updatedSuggestionsObservable = suggestionPropObservable .map (Replacements . returnVoid ());
4647 }
4748
4849 public Observable <Void > didUpdateSuggestion () {
You can’t perform that action at this time.
0 commit comments