Is any way to create an RxJava2 Observable
to notify state changes? like:
private var internalState = "state1"
val state: Observable<String> = Observable(...)
...
fun updateState(newState: String) { ... } // !!! attention: I need to notify all subscribers about this new state
then use it every where like:
// observe on state
state.subscribe(...)
this subscription must be called every state updates