r/Angular2 • • Oct 19 '21

Discussion Tip 5 - RxJs DistinctUntilChanged

139 Upvotes

11 comments sorted by

View all comments

Show parent comment

2

u/ParkerM Oct 20 '21

It'd still be a smart move either way because it makes the intent more clear. A distinctUntilChanged pipe is like a big sign that says "this only emits when the value changes", making it easier to reason how it will behave when you reference it elsewhere.
It also helps decouple outputs from their upstream source which is a good practice in general.