Skip to content

Commit 6a6f7e4

Browse files
authored
Merge pull request #4 from junkboy0315/master
Don't use lodash.debounce when timeout is set to 0
2 parents b40a800 + 6634943 commit 6a6f7e4

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)