Skip to content

Commit

Permalink
feat: allow changing mouseMoveThrottleMS (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-firstorder authored and mattlewis92 committed Jan 14, 2020
1 parent e107b25 commit fb5599b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/resizable.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 }) => {
Expand Down

0 comments on commit fb5599b

Please sign in to comment.