From fb5599b45db0384e57799ef3c072481f726dfd84 Mon Sep 17 00:00:00 2001 From: Philip <30979663+philip-firstorder@users.noreply.github.com> Date: Tue, 14 Jan 2020 19:46:07 +0100 Subject: [PATCH] feat: allow changing mouseMoveThrottleMS (#106) --- src/resizable.directive.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/resizable.directive.ts b/src/resizable.directive.ts index b49ed17..5c430dd 100644 --- a/src/resizable.directive.ts +++ b/src/resizable.directive.ts @@ -324,6 +324,11 @@ export class ResizableDirective implements OnInit, OnChanges, OnDestroy { * Allow elements to be resized to negative dimensions */ @Input() allowNegativeResizes: boolean = false; + + /** + * The mouse move throttle in milliseconds, default: 50 ms + */ + @Input() mouseMoveThrottleMS: number = MOUSE_MOVE_THROTTLE_MS; /** * Called when the mouse is pressed and a resize event is about to begin. `$event` is a `ResizeEvent` object. @@ -448,7 +453,7 @@ export class ResizableDirective implements OnInit, OnChanges, OnDestroy { switchMap(legacyResizeEdgesEnabled => legacyResizeEdgesEnabled ? mousemove$ : EMPTY ), - auditTime(MOUSE_MOVE_THROTTLE_MS), + auditTime(this.mouseMoveThrottleMS), takeUntil(this.destroy$) ) .subscribe(({ clientX, clientY }) => {