I am trying to refine the filter in my Observer over time, and I was wondering what they best way of doing this is.
e.g. myObservable.Where(x=>x.Color=="red").Subscribe();
and then myObservable.Where(x=>x.Color=="blue").Subscribe();
and then merge the two into one stream so that OnNext()
is called on Red OR Blue observables.
Maybe it hasn't fully clicked what is going on for me.
What if I also have myObservable.Where(x=>x.Type=="Car").Subscribe();
. It will keep calling the same OnNext() method each time? What use is this to me.. I might want to react differently depending on which subscription calls the update, but at the same time I might want to flatten the subscriptions.
e.g. In the above scenario, if the colour is red I want to write 'new red object', and if it's a car I want to write 'new car'. How would I do this in Rx? There is an overload on the subscribe for OnNext,OnError etc.. but that requires the Observer to be an observable too (Subject).. correct me if I'm wrong.
This makes no sense to me.. why should something that is observing changes also be observable?