From 6dcdf281b829348e69d770ed235affbc846f6352 Mon Sep 17 00:00:00 2001 From: Krunoslav Zaher Date: Sun, 13 Dec 2015 00:27:02 +0100 Subject: [PATCH] Moves `disctinctUntilChanged` to `ActivityIndicator`. --- .../GitHubSearchRepositoriesViewController.swift | 1 - RxExample/RxExample/Services/ActivityIndicator.swift | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/RxExample/RxExample/Examples/GitHubSearchRepositories/GitHubSearchRepositoriesViewController.swift b/RxExample/RxExample/Examples/GitHubSearchRepositories/GitHubSearchRepositoriesViewController.swift index f0c4d5f6..637c85c7 100644 --- a/RxExample/RxExample/Examples/GitHubSearchRepositories/GitHubSearchRepositoriesViewController.swift +++ b/RxExample/RxExample/Examples/GitHubSearchRepositories/GitHubSearchRepositoriesViewController.swift @@ -124,7 +124,6 @@ class GitHubSearchRepositoriesViewController: ViewController, UITableViewDelegat // activity indicator in status bar // { GitHubSearchRepositoriesAPI.sharedAPI.activityIndicator - .distinctUntilChanged() .driveNext { active in UIApplication.sharedApplication().networkActivityIndicatorVisible = active } diff --git a/RxExample/RxExample/Services/ActivityIndicator.swift b/RxExample/RxExample/Services/ActivityIndicator.swift index f86c5b34..84881e67 100644 --- a/RxExample/RxExample/Services/ActivityIndicator.swift +++ b/RxExample/RxExample/Services/ActivityIndicator.swift @@ -46,6 +46,7 @@ class ActivityIndicator : DriverConvertibleType { init() { _loading = _variable .map { $0 > 0 } + .distinctUntilChanged() .asDriver { (error: ErrorType) -> Driver in _ = fatalError("Loader can't fail") return Drive.empty()