com.artemzin.rxui2:rxui-test

Implementation of pure functional concept of talking to Android View layer in a Reactive way


License
Apache-2.0

Documentation

RxUi: Observable <-> Observable

Minimal implementation of the concept of talking to Android View layer in a Reactive way described here.

RxUi solves 3 main problems of communication between Presenters/ViewModels/etc and View layer in Android applications:
  1. Main Thread should be part of View layer, Presenters/ViewModels/etc should not know about it.
  2. Action posted to Main Thread should be part of Subscription so you could unsubscribe() it.
  3. Backpressure occurred on the View layer should be detected and handled on Presenter/ViewModel/etc layer above.

Sample Apps

Check Sample app written in Java and Sample app written in Kotlin.

RxUi is so tiny that you may not even see it in the code at the first sight!


Basically, RxUi is just two main functions:
  1. bind(Observable<T>): Subscription
  2. ui(Action1<T>): Func1<Observable<T>, Subscription>

And concept of Observable <-> Observable in the View layer when View only produces Observables and consumes Observables.

interface SignInView {
  // Produces.
  Observable<String> login();
  Observable<String> password();
  Observable<Void>   signInClicks();

  // Consumes.
  Func1<Observable<Boolean>,    Subscription>   signInEnable();
  Func1<Observable<SignInResult>, Subscription> signInResult();
}

Download

RxUi

Only two functions at the moment: RxUi.bind() (use it in Presenters/ViewModels) and RxUi.ui() use it in View layer.

compile 'com.artemzin.rxui:rxui:1.0.1'

 

RxUi Test

Only one function at the moment: TestRxUi.testUi(), basically same as RxUi.ui() except that it's synchronous and does not know about Main Thread.

testCompile 'com.artemzin.rxui:rxui-test:1.0.1'

 

RxUi Kotlin

Only one extension function at the moment: Observable.bind(), absolutely same as RxUi.bind() but easier to use in Kotlin.

compile 'com.artemzin.rxui:rxui-kotlin:1.0.1'

 


Made with ❤️ by Artem Zinnatullin, discussed with Juno Android Team and @FE_Hudl.