Lives - Android LiveData Extensions for Kotlin and Java
map
and switchMap
operators are now using the implementation of Android LiveData KTX .zip
and combineLatest
functions are now nullable.just(value)
to liveDataOf(value)
, since just was too broad.from { }
to liveDataOf { }
, since just was too broad.empty()
to emptyLiveData()
, since empty was too broad.This release adds support for the following operators:
Sample
LiveData.sampleWith(otherLiveData)
: Samples the current live data with other live data, resulting in a live data that emits the last value emitted by the original live data (if any) whenever the other live data emitsScan
scan(accumulator)
: Applies the accumulator function to each emitted item, starting with the second emitted item. Initial value of the accumulator is the first item.scan(seed, accumulator)
: Applies the accumulator function to each emitted item, starting with the initial seed.CombineLatest
combineLatest(firstLiveData, secondLiveData, combineFunction)
: combines both of the LiveDatas using the combineFunction and emits a value after any of them have emitted a value.empty<T>()
to easily create MutableLiveData
objects.Initial version is up and running on maven.