I have the following observable exposed by an object through property.
IObservable<HumidityLevel> humidity;
But the above observable is not created until after a method of that object is called. But subscribers have to subscribe at the time of construction of that object that is exposing the above observable.
One way I could think of is to create an empty observable so subscribers can subscribe
IObservable<HumidityLevel> humidity = Observable.Empty<HumidityLevel>();
And later on in the object's lifetime when the actual observable is ready, merge that into the above existing ones.
humidity = humidity.Concat(actualHumidityObservable)
Now the above line obviously modifies the humidity reference that the Subscribers are not subscribed to so they will never hear from this object.
How do I achieve what I am trying to do ? Is there any extension in Rx that can Merge into an existing observable so subscribers are preserved ?