I am facing an issue where I need to restrict the usage of rxjs's subscribe
method to only certain property changes. I attempted to achieve this using distinctUntilChanged
, but it seems like there is something missing in my implementation.
The specific requirement is for the subscribe function to be triggered only when the data.members[]
property undergoes a change.
this.myService.loadData(this.data.id)
.distinctUntilChanged()
.subscribe(data => {
this.data = data;
console.log("data changed", data);
});
I would appreciate guidance on how to effectively respond to distinct changes in this scenario.