SkillAgentSearch skills...

RxDatabindings

RxJava2 & 3 extensions for Android Databindings library

Install / Use

/learn @stepango/RxDatabindings
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

RxDatabindings

Download Android CI

RxJava 2 & 3 extensions for Android Databindings library

Add RxDataBindings to your build.gradle

implementation "com.stepango.rxdatabindings:rxdatabindings:3.0.0"

Basic example of usage:

interface ViewModelState : Parcelable {
    val text: ObservableString
    val counter: ObservableInt
}

@Parcelize
data class ViewModelStateImpl(
        override val text: ObservableString = ObservableString(),
        override val counter: ObservableInt = ObservableInt()
) : ViewModelState

class ViewModel(val state: ViewModelState) : ViewModelState by state {

    init {
        counter.observe()
                .setTo(text) { "Wow! You count till $it" }
                .doOnNext { Log.d("THREAD", Thread.currentThread().name) }
                .subscribe()
    }

    fun incCounter() = counter.inc(10)
    fun decCounter() = counter.dec(0)

}

Related Skills

View on GitHub
GitHub Stars41
CategoryDevelopment
Updated1y ago
Forks8

Languages

Kotlin

Security Score

65/100

Audited on Apr 2, 2025

No findings