Repository navigation
Immutable
release. Only release title and notes can be modified.
2.0.0 adds 11 new operators, makes combineLatest and merge easier to use from Kotlin, and drops functions that AndroidX Lifecycle now provides itself.
Breaking changes
map,switchMapanddistinctUntilChanged()are removed. Import them fromandroidx.lifecycleinstead; the calls stay the same.liveData(),liveData(value)andliveData { }are renamed toemptyLiveData(),liveDataOf(value)andlazyLiveData { }, becauseliveData { }clashed with the AndroidX coroutine builder.combineLatestandmergereturnLiveData<T>instead ofLiveData<out T>, so casts at call sites are no longer needed.- The
LiveDataparameter ofstartWithis renamed fromvaluetoother. This only affects named arguments. - Requirements: minSdk 23 (was 14), Kotlin 2.1 (was 1.8), AndroidX Lifecycle 2.11.0 (was 2.6.2).
Behavior changes
takeandskipthrowIllegalArgumentExceptionfor a negative count.bufferthrowsIllegalArgumentExceptionunlesscountandskipare greater than zero.emptyLiveData()returns a new instance on every call;liveData()returned a shared one.
New operators
skipUntil, with a predicate or anotherLiveData, andtakeUntilwith anotherLiveDatascan,withLatestFrom,sample,amb/ambWith,elementAt,startWithwith several elements,mapNotNull,skipLast,zipWithNext
Fixes
skipWhileskips elements only while the predicate returnstrue.buffer(count, skip)withskipsmaller thancountemits overlapping lists ofcountelements.castandfilterIsInstancework with primitive classes such asInt::class.java.combineLatestandmergeaccept the same source more than once.
What's Changed
- Updates build, dependencies and CI by @musichin in #90
- aligns Android namespace with package name by @musichin in #91
- Uses Kover's coverage engine instead of JaCoCo by @musichin in #92
- Makes combineLatest and merge return LiveData instead of LiveData by @musichin in #93
- Removes map in favor of the AndroidX Lifecycle extension by @musichin in #94
- Removes switchMap in favor of the AndroidX Lifecycle extension by @musichin in #95
- Removes distinctUntilChanged() in favor of the AndroidX Lifecycle extension by @musichin in #96
- Adds skipUntil to skip elements until the predicate returns true by @musichin in #97
- Adds scan to emit running accumulations of the elements by @musichin in #98
- Adds withLatestFrom to combine each element with the latest element of another LiveData by @musichin in #99
- Adds takeUntil and skipUntil overloads that stop taking or skipping once another LiveData emits by @musichin in #100
- Adds sample to emit the latest element whenever another LiveData emits by @musichin in #101
- Adds amb and ambWith to follow whichever source emits first by @musichin in #102
- Adds elementAt to emit only the element at a given index by @musichin in #103
- Adds a vararg startWith to start with several elements by @musichin in #104
- Adds mapNotNull to emit only the non-null results of a transform by @musichin in #105
- Adds skipLast to skip the last elements by delaying each one by @musichin in #106
- Adds zipWithNext to pair each element with the one before it by @musichin in #107
- Improves KDoc consistency across operators by @musichin in #108
- Renames the liveData factories to avoid a clash with AndroidX by @musichin in #109
- Enables explicit API mode so every public declaration states its visibility by @musichin in #110
- Improves the README for 2.0 by @musichin in #111
Full Changelog: 1.2.1...2.0.0