RxJava integration
To use the disposables
and RxScreenModel
you should first import cafe.adriel.voyager:voyager-rxjava
(see Setup).
CompositeDisposable
The ScreenModel
provides a disposables
property. It's cleared automatically when the ScreenModel
is disposed.
State-aware ScreenModel
If your ScreenModel
needs to provide a state, use the RxScreenModel
. Use mutableState
to change the current state.
In your screen use state.subscribeAsState()
and handle the current state.
Sample
Sample code here.
Last updated