Last active
April 24, 2018 14:28
-
-
Save lcssanches/6929d4c3ef9ad6c22584f22c1378c8bd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* ... */ | |
updateMobile(mobile){ | |
return function (dispatch) { | |
return axios.post('/update-mobile',{mobile}) | |
.then(response=>{ | |
dispatch(success()); | |
}) | |
.catch(e=>{ | |
dispatch(error()) | |
}); | |
} | |
} |
This file contains hidden or 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
cena.js | |
/* ... */ | |
function onPressButton(){ | |
this.props.updateMobile(mobile).then(()=>{ | |
if(this.props.success){ | |
this.props.navigation.navigate('proximo'); | |
} | |
}); | |
} | |
/* ... */ | |
//mapDispatchToProps (success), mapStateToProps (updateMobile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment