Skip to content

Instantly share code, notes, and snippets.

@jacobp100
Last active July 16, 2016 21:27
Show Gist options
  • Save jacobp100/13a0a534b6823bdcfcc81e706c6daa73 to your computer and use it in GitHub Desktop.
Save jacobp100/13a0a534b6823bdcfcc81e706c6daa73 to your computer and use it in GitHub Desktop.
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