
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
@tinkoff/ng-event-filters
Advanced tools
This is a library for optimizing performance sensitive events and declarative preventDefault and stopPropagation
@tinkoff/ng-event-filters is a tiny (1KB gzip) library for optimizing change detection cycles for performance sensitive events (such as touchmove, scroll, drag etc.) and declarative preventDefault() and stopPropagation().
Add new providers to your app module:
import {NgModule} from '@angular/core';
import {PLUGINS} from '@tinkoff/ng-event-filters'; // <-- THIS
@NgModule({
bootstrap: [
/*...*/
],
imports: [
/*...*/
],
declarations: [
/*...*/
],
providers: [...PLUGINS], // <-- GOES HERE
})
export class AppModule {}
Use new modifiers for events in templates and in @HostListener:
.stop to call stopPropagation() on event.prevent to call preventDefault() on event.silent to call event handler outside Angular's NgZoneFor example:
<div (mousedown.prevent)="onMouseDown()">
Clicking on this DIV will not move focus
</div>
<div (click.stop)="onClick()">
Clicks on this DIV will not bubble up
</div>
<div (mousemove.silent)="onMouseMove()">
Callbacks to mousemove will not trigger change detection
</div>
You can also re-enter NgZone and trigger change detection, using @filter decorator:
<div (scroll.silent)="onScroll($event.currentTarget)">
Scrolling this DIV will only trigger change detection and onScroll callback if it is
scrolled to bottom
</div>
import {filter} from '@tinkoff/ng-event-filters';
export function scrollFilter(element: HTMLElement): boolean {
return element.scrollTop === element.scrollHeight - element.clientHeight;
}
// ...
@filter(scrollFilter)
onScroll(_element: HTMLElement) {
this.someService.requestMoreData();
}
All examples above work the same when used with
@HostListener.
Filter function will be called with the same arguments as the
decorated method. Decorated method will be called and change detection
triggered if filter function returns true.
Filter function must be exported named function for AOT, arrow functions will trigger build error.
.silent modifier will not work with built-in keyboard pseudo-events,
such as keydown.enter or keydown.arrowDown since Angular re-enters NgZone
inside internal handlers.
Do you also want to open-source something, but hate the collateral work? Check out this Angular Open-source Library Starter we’ve created for our projects. It got you covered on continuous integration, pre-commit checks, linting, versioning + changelog, code coverage and all that jazz.
FAQs
This is a library for optimizing performance sensitive events and declarative preventDefault and stopPropagation
We found that @tinkoff/ng-event-filters demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.