Skip to content

Commit 6634943

Browse files
committed
ignore lodash.debounce if debounce is set to 0
1 parent b40a800 commit 6634943

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ class BottomScrollListener extends Component {
66
constructor(props) {
77
super(props);
88

9-
this.handleOnScroll = debounce(this.handleOnScroll.bind(this), props.debounce, { trailing: true });
9+
if (props.debounce) {
10+
this.handleOnScroll = debounce(this.handleOnScroll.bind(this), props.debounce, { trailing: true });
11+
} else {
12+
this.handleOnScroll = this.handleOnScroll.bind(this);
13+
}
1014
}
1115

1216
componentDidMount() {

0 commit comments

Comments
 (0)