Skip to content

Commit fb5599b

Browse files
philip-firstordermattlewis92
authored andcommitted
feat: allow changing mouseMoveThrottleMS (mattlewis92#106)
1 parent e107b25 commit fb5599b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/resizable.directive.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ export class ResizableDirective implements OnInit, OnChanges, OnDestroy {
324324
* Allow elements to be resized to negative dimensions
325325
*/
326326
@Input() allowNegativeResizes: boolean = false;
327+
328+
/**
329+
* The mouse move throttle in milliseconds, default: 50 ms
330+
*/
331+
@Input() mouseMoveThrottleMS: number = MOUSE_MOVE_THROTTLE_MS;
327332

328333
/**
329334
* 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 {
448453
switchMap(legacyResizeEdgesEnabled =>
449454
legacyResizeEdgesEnabled ? mousemove$ : EMPTY
450455
),
451-
auditTime(MOUSE_MOVE_THROTTLE_MS),
456+
auditTime(this.mouseMoveThrottleMS),
452457
takeUntil(this.destroy$)
453458
)
454459
.subscribe(({ clientX, clientY }) => {

0 commit comments

Comments
 (0)