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