So I keep reading everywhere that use of Subject<T>
is "bad" - and I kind of agree with the reasoning.
However, I am trying to think of the best way to avoid using it and have an example.
Currently I have an abstract class for my persisted configuration classes that has a protected Save()
method on it which is called whenever changing a property should persist the class. This message pumps a message onto a Subject<T>
which is exposed through IObservable<T>
interface which the serialisation services listens to and serialises the class. This seemed the most obvious, simple and quickest way to implement this at the time.
So what would be the RX way to do this without using a Subject? Would I instead expose an event and use Observable.FromEventPattern()
to subscribe to it? - as this seems a more complex way to go about it.