Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run a data request #3

Open
socker03 opened this issue Jul 28, 2016 · 3 comments
Open

How to run a data request #3

socker03 opened this issue Jul 28, 2016 · 3 comments

Comments

@socker03
Copy link

Hey. Good job.

I had a following problem.
I have a component when it is created by all the good called resolveData() loading data, but later when updated props userId data is not reloaded. You may want to expand the functionality? What ideas do you have about this?

@connect({
  feed: '...',
})
export default class UserWallPosts extends DataComponent {
  resolveData() {
    const { userId } = this.props
    .... getData(userId) ....
  }

  renderData(data) {}
}
@yocontra
Copy link
Member

Could add some checking to componentWillUpdate to re-check and call resolveData again - want to take a crack at a PR?

@socker03
Copy link
Author

Yes, I do PR. How to pass a props to check into DataComponent?

@socker03
Copy link
Author

socker03 commented Aug 4, 2016

Maybe do so, add setPropsForRefresh to shasta-data-view

handleResolved() {
  this.setPropsForRefresh('propName1', 'propName2')
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants