@Test public void testStartFetchingReportedAsLoading() throws Exception { assertEquals(LOADING, toProgressStatus().apply(ongoing())); }
@NonNull static Function<DataStreamNotification<GitHubRepositorySearch>, ProgressStatus> toProgressStatus() { return notification -> { if (notification.isOngoing()) { return ProgressStatus.LOADING; } else if (notification.isCompletedWithError()) { return ProgressStatus.ERROR; } else { return ProgressStatus.IDLE; } }; }
RepositoriesViewModel extends AbstractViewModel { @NonNull static Function<DataStreamNotification<GitHubRepositorySearch>, ProgressStatus> toProgressStatus() { return notification -> { if (notification.isOngoing()) { return ProgressStatus.LOADING; } else if (notification.isCompletedWithError()) { return ProgressStatus.ERROR; } else { return ProgressStatus.IDLE; } }; } }
RepositoriesViewModel extends AbstractViewModel { @NonNull static Function<DataStreamNotification<GitHubRepositorySearch>, ProgressStatus> toProgressStatus() { return notification -> { if (notification.isOngoing()) { return ProgressStatus.LOADING; } else if (notification.isCompletedWithError()) { return ProgressStatus.ERROR; } else { return ProgressStatus.IDLE; } }; } RepositoriesViewModel(@NonNull final GetGitHubRepositorySearch getGitHubRepositorySearch,
                                 @NonNull final GetGitHubRepository getGitHubRepository); }
RepositoriesViewModel extends AbstractViewModel { @NonNull static Function<DataStreamNotification<GitHubRepositorySearch>, ProgressStatus> toProgressStatus() { return notification -> { if (notification.isOngoing()) { return ProgressStatus.LOADING; } else if (notification.isCompletedWithError()) { return ProgressStatus.ERROR; } else { return ProgressStatus.IDLE; } }; } RepositoriesViewModel(@NonNull final GetGitHubRepositorySearch getGitHubRepositorySearch,
                                 @NonNull final GetGitHubRepository getGitHubRepository); @NonNull Observable<GitHubRepository> getSelectRepository(); @NonNull Observable<List<GitHubRepository>> getRepositories(); @NonNull Observable<ProgressStatus> getNetworkRequestStatusText(); void setSearchString(@NonNull final String searchString); void selectRepository(@NonNull final GitHubRepository repository); @Override void subscribeToDataStoreInternal(@NonNull final CompositeDisposable compositeDisposable); }
RepositoriesViewModel extends AbstractViewModel { @NonNull static Function<DataStreamNotification<GitHubRepositorySearch>, ProgressStatus> toProgressStatus() { return notification -> { if (notification.isOngoing()) { return ProgressStatus.LOADING; } else if (notification.isCompletedWithError()) { return ProgressStatus.ERROR; } else { return ProgressStatus.IDLE; } }; } RepositoriesViewModel(@NonNull final GetGitHubRepositorySearch getGitHubRepositorySearch,
                                 @NonNull final GetGitHubRepository getGitHubRepository); @NonNull Observable<GitHubRepository> getSelectRepository(); @NonNull Observable<List<GitHubRepository>> getRepositories(); @NonNull Observable<ProgressStatus> getNetworkRequestStatusText(); void setSearchString(@NonNull final String searchString); void selectRepository(@NonNull final GitHubRepository repository); @Override void subscribeToDataStoreInternal(@NonNull final CompositeDisposable compositeDisposable);  }