I'm new in RxSwift, I have this code snipped that print in my console:
next(second value)
completed
but I was expecting this result:
next(first value)
next(second value)
completed
why is not reacting twice the subscribe? I understand that in react, the observable emits and trigger the subscribe evert time that the variable that we are observing change but the code is not showing this. Do I misunderstand the concept?
var mutableString = "first value"
mutableString = "second value"
var stringObservable: Observable<String> = Observable.of(mutableString)
stringObservable.subscribe { event in
print(event)
}
question from:https://stackoverflow.com/questions/65864891/observable-only-emits-one-value