When working with Angular, I find myself frequently displaying members of classes in an Angular HTML template. These classes often share common members structured like this:
class Foo {
bar: string;
bas: Date;
}
There are instances where I need to manually refresh the view if any members of Foo objects change. Utilizing Angular, I could leverage BehaviourSubject from rxjs, along with the async pipe, to streamline render detection. However, is it considered an anti-pattern to replace many class/object members with BehaviourSubject? Are there any drawbacks to using this approach?
class Foo {
bar: BehaviourSubject<string>;
bas: BehaviourSubject<Date>;
}