From abb3f3ca6677f2c17787d6731c186e0bf6deec0e Mon Sep 17 00:00:00 2001
From: Janne Koschinski <janne@kuschku.de>
Date: Wed, 15 May 2019 17:38:47 +0200
Subject: [PATCH] Removed unused functions

---
 .../util/helper/LiveDataHelper.kt             | 28 -------------------
 1 file changed, 28 deletions(-)

diff --git a/viewmodel/src/main/java/de/kuschku/quasseldroid/util/helper/LiveDataHelper.kt b/viewmodel/src/main/java/de/kuschku/quasseldroid/util/helper/LiveDataHelper.kt
index e7fdfd6f0..504067f1f 100644
--- a/viewmodel/src/main/java/de/kuschku/quasseldroid/util/helper/LiveDataHelper.kt
+++ b/viewmodel/src/main/java/de/kuschku/quasseldroid/util/helper/LiveDataHelper.kt
@@ -22,7 +22,6 @@ package de.kuschku.quasseldroid.util.helper
 
 import androidx.annotation.MainThread
 import androidx.lifecycle.*
-import io.reactivex.BackpressureStrategy
 import io.reactivex.Observable
 
 @MainThread
@@ -77,33 +76,6 @@ inline fun <X, Y> LiveData<X>.switchMapNotNull(
   return result
 }
 
-@MainThread
-inline fun <X, Y> LiveData<X?>.switchMapRx(
-  strategy: BackpressureStrategy,
-  crossinline func: (X) -> Observable<Y>?
-): LiveData<Y?> {
-  val result = MediatorLiveData<Y>()
-  result.addSource(
-    this, object : Observer<X?> {
-    var mSource: LiveData<Y>? = null
-
-    override fun onChanged(x: X?) {
-      val newLiveData = if (x == null) null else func(x)?.toLiveData(strategy)
-      if (mSource === newLiveData) {
-        return
-      }
-      mSource?.let(result::removeSource)
-      mSource = newLiveData
-      if (newLiveData != null) {
-        result.addSource(newLiveData) { y -> result.value = y }
-      } else {
-        result.value = null
-      }
-    }
-  })
-  return result
-}
-
 @MainThread
 inline fun <X, Y> LiveData<out X?>.map(
   crossinline func: (X) -> Y?
-- 
GitLab