RxKotlin Versions Save

RxJava bindings for Kotlin

2.0.1

7 years ago

This release focuses on "workaround" fixes for the SAM conversion issue when using Kotlin with RxJava 2.x.

Currently, the Kotlin compiler gets confused and cannot infer when presented with multiple SAM parameter overloads. Hopefully, JetBrains will resolve this issue sooner than later. Until then, we have put together some helpers to get us by:

  • Non-SAM zip() and withLatestFrom() extension function operators were added to Observable, Flowable, Single, and Maybe where applicable.

  • Observables, Flowables, Singles, and Maybes classes were added to house Kotlin-friendly non-SAM versions of zip() and combineLatest().

This does not address all operators affected by the SAM issue, but these are commonly encountered and will serve as a good start. For instance, the subscribe() function on Single and Maybe will be addressed later as they may require a different method signature.

Thanks to @chris-horner for spearheading this idea.

2.0.1-RC1

7 years ago

This is the RC for 2.0.1 which includes workaround fixes for the SAM conversion issue when using Kotlin with RxJava 2.x.

  • Non-SAM zip() and withLatestFrom() extension function operators were added to Observable, Flowable, Single, and Maybe where applicable.

  • Observables, Flowables, Singles, and Maybes classes were added to house Kotlin-friendly non-SAM versions of zip() and combineLatest().

This does not address all operators affected by the SAM issue, but these are commonly encountered and will serve as a good start. For instance, the subscribe() function on Single and Maybe will be addressed later as they may require a different method signature.

Thanks to @chris-horner for spearheading this idea.

2.0.0

7 years ago

This is the official release of RxKotlin 2.0, backed by RxJava 2.0.7.

The notes from the RxKotlin 1.0 release apply, but there are a few additional things to call out in this release:

  • RxKotlin 2.0 supports RxJava 2.x (RxKotlin 1.0 supports RxJava 1.x)
  • Observable, Flowable, Single, Maybe, and Completable types are targeted with extension functions
  • subscribeBy() supports both Observers and Subscribers
  • Disposables and Subscriptions are both supported with convenience extension functions
  • Non-null enforcement is applied to extension function factories targeting Kotlin types, since RxJava2 does not support null emissions
  • A small set of operators targeting Observable<Single>, Flowable<Single>, Observable<Maybe>, etc are implemented as extension functions.
  • Maven groupId has been changed to io.reactivex.rxjava2
  • Root package is now io.reactivex.rxkotlin

Special thanks to @stepango for doing a lot of the work porting this over to RxJava2.

1.0.0

7 years ago

This is the official release of RxKotlin 1.0, backed by RxJava 1.2.7. The vision of RxKotlin is to standardize conventions for using RxJava with Kotlin.

This project has evolved in the past few years as everyone got their bearings on Kotlin and what standards should emerge, especially when used with RxJava. Because Kotlin introduced non-member functions like listOf() and sequenceOf(), there was experimentation in doing similar functions like observable { }. Extension functions allowed many interesting possibilities as well.

These experiments revealed some interesting natures about the Kotlin language. Kotlin's conciseness and lack of boilerplate easily marginalizes the need to create libraries to save a few lines of code. Intentions to create syntactic sugar can quickly result in syntactic saccharin, and such personal preferences belong in one's internal domain rather than an OSS library. This was particularly the case with non-member functions like observable { }. Therefore, these were the first items to be removed.

Operators that are not standard in ReactiveX were removed as well to tighten focus of the library. Useful operators that are not part of the ReactiveX standard are likely better off in RxJava-Extras or a Kotlin equivalent.

The majority of what remains in RxKotlin are Observable factories turned into extension functions, a small and focused set of operators, a subscribeBy() builder, and a few strategically convenient extension functions.

This library may be lightweight, but hopefully it will help establish a useful standard in using RxJava with Kotlin going forward. Special thanks to @MarioAriasC, @benjchristensen, @stepango, and @JakeWharton for all their research, experimentation, contributions, efforts, and input.

For those using RxJava 2.x, RxKotlin 2.0 will be coming shortly!

2.0.0-RC3

7 years ago

GroupID has been changed to io.reactivex.rxjava2

The only other change in 2.0.0-RC3 is withIndex() and joinToString() have been removed. Extension function operators that deviate from ReactiveX standard operators were deemed out of scope for this project.

These operators might go into an initiative like rxkotlin-extras.

1.0.0-RC3

7 years ago

The only change in 1.0.0-RC3 is withIndex() and joinToString() have been removed. Extension function operators that deviate from ReactiveX standard operators were deemed out of scope for this project.

These operators might go into an initiative like rxkotlin-extras.

2.0.0-RC1

7 years ago

This is the release candidate for RxKotlin 2.0, which is backed by RxJava 2.x.

The API highly mirrors the release candidate of RxKotlin 1.0, but of course accommodates the types and nuances of RxJava 2.0.

Here is a list of differences from the RxKotlin 1.0 version:

  • Package domain is io.reactivex.rxkotlin
  • Extensions are applicable to Observable and Flowable
  • Extension functions targeting null emissions have been removed
  • Extension functions have been added for Single, Maybe, and Completable
  • onComplete is the completion event name instead of onCompleted
  • Extension functions targeting Subscription now target Disposable

1.0.0-RC2

7 years ago

On top of RC1 changes, RC2 changes all references of onComplete to onCompleted to conform to RxJava 1.x standard.

This release is also to perform a second test deployment to Maven Central.

1.0.0-RC1

7 years ago

This is the release candidate of RxKotlin 1.0, which is backed by RxJava 1.2.7 and Kotlin 1.1. Please review this library and let us know if you have any feedback before the official 1.0 release, which we are aiming to do fairly quickly. Next we will tackle RxKotlin 2.0 which will be backed by RxJava 2.x.

Some of the changes in this API from the 0.x versions:

  • All non-member function factories have been removed as discussed in #58.

  • Observable<T>#joinToString() extension function added to reduce emissions to a concatenated String, with an optional separator and prefix/postfix.

  • xxxArray#.toObservable() extension functions have been corrected to iterate arrays as Iterables and not convert them to Lists, ensuring mutations are captured for subsequent subscriptions.

  • The Observable<T>#lift() and Observable<T>#fold() extension functions have been removed.

  • subscribeWith() has been rename to subscribeBy() to prevent convention clashing with RxJava2, and has been greatly simplified in its implementation.

  • All Subject functions masquerading as constructors have been removed.

  • Extension functions targeting List<Observable<T>> now target Iterable<Observable<T>>.

  • A handful of extension functions targeting Observable<Observable<T>> have been ported from RxPy, including mergeAll(), concatAll(), and switchLatest().

v0.60.0

7 years ago