I am using Angular, and I have a couple of classes whose members I display in an Angular HTML template. These classes have common members like this:
class Foo {
bar: string;
bas: Date;
}
In many cases I have to manually refresh the view if members of Foo objects changed. Since I am using Angular, I could make use of BehaviourSubject from rxjs in combination with the async pipe to simplify the render detection. Is it an anti-pattern to replace many class/object members with BehaviourSubject? Is there a downside to this?
class Foo {
bar: BehaviourSubject<string>;
bas: BehaviourSubject<Date>;
}