Skip to content

Commit 2e277a8

Browse files
authored
Merge pull request #11 from ChrisDahmCS/bugfix/use-debounce-in-operator
fix(debounce): use the debounce input as the debounce operator value
2 parents 8eafbdc + 481d8c9 commit 2e277a8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/app/infinite-scroll/infinite-scroll.directive.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import * as events from './shared/events';
2121
* snInfiniteScroll
2222
* (scrollEnd)="onScrollEnd()"
2323
* [offset]="100"
24+
* [debounce]="123"
2425
* [disabled]="disabled">
2526
* </div>
2627
* ```
@@ -43,7 +44,7 @@ export class InfiniteScrollDirective implements AfterViewInit, OnDestroy {
4344
/**
4445
* Specify debounce duration in ms
4546
*/
46-
@Input() public debounce = 0;
47+
@Input() public debounce = 100;
4748
/**
4849
* If true then `scrollEnd` event should NOT be emitted
4950
*/
@@ -66,7 +67,7 @@ export class InfiniteScrollDirective implements AfterViewInit, OnDestroy {
6667
this.scroll$
6768
.pipe(
6869
takeUntil(this.ngUnsubscribe$),
69-
debounceTime(100),
70+
debounceTime(this.debounce),
7071
map(scroll => {
7172
const y = scroll.y + this.offset;
7273
return { y, height: scroll.height };

0 commit comments

Comments
 (0)