Skip to content

Instantly share code, notes, and snippets.

@jack-guy
Last active March 11, 2019 00:29
Show Gist options
  • Save jack-guy/af80568d1c8b4e42ea4f6f2ada8f58f9 to your computer and use it in GitHub Desktop.
Save jack-guy/af80568d1c8b4e42ea4f6f2ada8f58f9 to your computer and use it in GitHub Desktop.
class AppComponent {
constructor () {
this.count = 5;
this.onResize = this._onResize.bind(this);
}
componentDidMount () {
window.addEventListener('resize', this.onResize)
}
componentWillUnmount () {
window.removeEventListener('resize', this.onResize);
}
async _onResize () {
await fetchIceCreams(this.count);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment