mlkwrz
mlkwrz

Reputation: 319

Kotlin Property Observable

In ReactiveUI we can use whenAny() to create observable from property or a group of properties. How can I achieve something similar in Kotlin?

Upvotes: 1

Views: 489

Answers (1)

creativedrewy
creativedrewy

Reputation: 101

From a purely language standpoint, if you've got RxJava in your project you can use any of the combination methods to collate results from multiple Observables. Check out the method list here:

Rx Combining Methods

It appears that there may not be a direct analog to whenAny() but you should be able to achieve something similar to what you are looking for from a reactive standpoint via zip, merge, or one of the other methods.

If you're also thinking specifically about Android UI Rx functionality, the ever prescient Jake Wharton has provided:

RxBinding Android UI

Hope this helps!

Upvotes: 4

Related Questions