Last active
May 13, 2018 03:40
-
-
Save radiegtya/c00c91ffabea391ec23d7b3beb0ff4c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// #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