Skip to content

Instantly share code, notes, and snippets.

@radiegtya
Last active May 13, 2018 03:40
Show Gist options
  • Save radiegtya/c00c91ffabea391ec23d7b3beb0ff4c0 to your computer and use it in GitHub Desktop.
Save radiegtya/c00c91ffabea391ec23d7b3beb0ff4c0 to your computer and use it in GitHub Desktop.
// #1. Remove export default from class
class Profiles extends Component{
state = {
data: {}
}
// #2. Remove getProfile method, because now we have it on actions
// getProfile(){
// const url = `https://api.backendless.com/221BAB21-F149-D2B2-FF55-B2DD8ECDFE00/31717453-DFFE-7469-FF91-D1EAC0C16700/data/profiles/564DD7D4-4F12-B56A-FFD5-1E4B0E7D9D00?loadRelations=experiences%2Ceducations`
// axios.get(url).then((result)=>{
// this.setState({
// data: result.data
// })
// })
// }
// #3. Instead directly call from own class method, call the actions that we made with "dispatch" method from redux
componentDidMount(){
this.props.dispatch(getProfile())
}
// ... THE REST OF CODE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment