I often have the situation where I want a UI element to "watch" an underlying value - supposing I am displaying an int - I want an an IObservable that I can subscribe to.
I have been using a Subject underneath, so I can just set it. That works really well... except for the first time. If I setup the subject - then later subscribe to it by opening a new UI element - it doesn't trigger an onnext until the next change.
I basically want something that works like a subject - but always and immediately does an onNext of the latest value to any new subscribers.
I know I can write such a construct myself - but it seems a common use case - is there something standard I'm missing?
BehaviorSubject<T>- Hasan Emrah Süngü