Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. class MyComponent extends PureComponent {
  2. constructor(props) {
  3. if (this.props.cloudId) {
  4. this.props.fetchData(this.props.cloudId);
  5. } else {
  6. this.waitForCloudId = () => {
  7. if (this.props.cloudId) {
  8. this.props.fetchData(this.props.cloudId);
  9. } else {
  10. setTimeout(this.waitForCloudId, 100);
  11. }
  12. };
  13. setTimeout(this.waitForCloudId, 100);
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement