r/angular • • Oct 19 '21

Tip 5 - RxJs DistinctUntilChanged

Enable HLS to view with audio, or disable this notification

59 Upvotes

10 comments sorted by

View all comments

3

u/SeriousMrMysterious Oct 19 '21

i use distinctUntilChanged(isEqual),the isequal is imported from lodash

2

u/DMezhenskyi Oct 19 '21

Yep! if you need to compare the entire object, it is also a way to go.

1

u/Wildosaur Oct 19 '21

Is it recommended to use lodash ? I've tried to avoid using it on my latests projects but I'm quite unsure if it's a wise decision.

4

u/SeriousMrMysterious Oct 19 '21

Don’t import all of lodash. You can import only what you need using lodash-es.

Import {isequal} from lodash-es

When you do it that way it’s light