This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* List of modules that don't require Jacoco | |
*/ | |
def ignoredByJacoco = [ | |
'presentation' | |
] | |
/** | |
* module class dirs | |
* */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun <A, B, R> zipMergeLiveData(a: LiveData<A>, b: LiveData<B>, zipper: (A, B) -> R): LiveData<R> { | |
return MediatorLiveData<R>().apply { | |
var lastA: A? = null | |
var lastB: B? = null | |
fun update() { | |
val localLastA = lastA | |
val localLastB = lastB | |
if (localLastA != null && localLastB != null) { | |
val foo = zipper.invoke(localLastA, localLastB) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidx.lifecycle.LiveData | |
import androidx.lifecycle.MediatorLiveData | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.Job | |
import kotlinx.coroutines.delay | |
import kotlinx.coroutines.launch | |
fun <T> LiveData<T>.debounce(duration: Long = 1000L, coroutineScope: CoroutineScope) = MediatorLiveData<T>().also { mld -> | |
val source = this |
OlderNewer