Last active
August 13, 2018 14:35
-
-
Save dance2die/478cd39c072ae76ef774c63efc9735b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
throttledWindowHandler = throttle( | |
this.windowSizeHandler, | |
debounceWaitTime, | |
debounceOptions | |
); | |
async componentDidMount() { | |
window.addEventListener("scroll", this.throttledWindowHandler); | |
window.addEventListener("resize", this.throttledWindowHandler); | |
const { posts } = this.state; | |
if (!posts || posts.length <= 0) { | |
await this.getNextPosts(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment