public class ViewModelReactor<Action,Mutation,State> implements Reactor<Action,Mutation,State>
Abstract Reactor implementing ViewModel. It handles action and state creation and clearing of the state observable.
Reactor.DefaultImpls| Constructor and Description |
|---|
ViewModelReactor(State initialState)
Abstract Reactor implementing ViewModel.
It handles action and state creation and clearing of the state observable.
|
| Modifier and Type | Method and Description |
|---|---|
com.jakewharton.rxrelay2.PublishRelay<Action> |
getAction()
The action from the view. Bind user inputs to this subject.
|
State |
getCurrentState()
The current state. This value is changed just after the state stream emits a new state.
|
io.reactivex.disposables.CompositeDisposable |
getDisposables()
The CompositeDisposable that contains the State Stream disposable.
|
State |
getInitialState()
The initial state.
|
io.reactivex.Observable<? extends State> |
getState()
The state stream. Use this observable to observe the state changes.
|
void |
onCleared() |
void |
setCurrentState(State p)
The current state. This value is changed just after the state stream emits a new state.
|
clear, createStateStream, getAction, getCurrentState, getDisposables, getInitialState, getState, mutate, reduce, setCurrentState, transformAction, transformMutation, transformStatepublic ViewModelReactor(State initialState)
Abstract Reactor implementing ViewModel. It handles action and state creation and clearing of the state observable.
initialState - The initial state.public io.reactivex.disposables.CompositeDisposable getDisposables()
The CompositeDisposable that contains the State Stream disposable.
public com.jakewharton.rxrelay2.PublishRelay<Action> getAction()
The action from the view. Bind user inputs to this subject.
public io.reactivex.Observable<? extends State> getState()
The state stream. Use this observable to observe the state changes.
public State getCurrentState()
The current state. This value is changed just after the state stream emits a new state.
public void setCurrentState(State p)
The current state. This value is changed just after the state stream emits a new state.
public void onCleared()
public State getInitialState()
The initial state.