Last active
July 16, 2016 21:27
-
-
Save jacobp100/13a0a534b6823bdcfcc81e706c6daa73 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Cats extends Component { | |
static fetchData({ location, dispatch }) { | |
return dispatch(setQueryParams(location.query)) | |
.then(() => dispatch(getCats())); | |
} | |
componentDidMount() { | |
Cats.fetchData(this.props); | |
} | |
componentDidUpdate() { | |
Cats.fetchData(this.props); | |
} | |
render() { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment