Last active
March 11, 2019 00:29
-
-
Save jack-guy/af80568d1c8b4e42ea4f6f2ada8f58f9 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
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