Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. class MyComponent extends React.Component {
  2. componentDidUpdate () {
  3. if (this.props.loggedIn) {
  4. api.getData()
  5. .then(() => {
  6. this.props.dispatch({
  7. type: 'gotData'
  8. })
  9. }, (reason) => {
  10. this.props.dispatch({
  11. type: 'getDataFailed'
  12. })
  13. })
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement