I am currently using skip(1) to avoid unnecessary calculations when the first value is typed. However, I discovered that my users frequently use copy-paste to filter data. As a result, skip(1) skips the entire pasted value.
I want to skip the first typed character only if it does not comes from a pasted value. I am not really interested in the copy paste, but more by the fact that the first value may be the full filter including that includes several characters.
Here’s my current code:
public ngAfterViewInit(): void {
this.quickFilterValueChange
.pipe(
skip(1),
debounceTime(150),
distinctUntilChanged(),
tap(() => {
this.store.dispatch(someAction);
}),
takeUntilDestroyed(this.destroyRef),
)
.subscribe();
}