Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyComponent extends React.Component {
- componentDidUpdate () {
- if (this.props.loggedIn) {
- api.getData()
- .then(() => {
- this.props.dispatch({
- type: 'gotData'
- })
- }, (reason) => {
- this.props.dispatch({
- type: 'getDataFailed'
- })
- })
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement