Skip to content

Instantly share code, notes, and snippets.

@melihmucuk
Created July 5, 2015 22:39
Show Gist options
  • Save melihmucuk/6eaf3657cb44bf27dd84 to your computer and use it in GitHub Desktop.
Save melihmucuk/6eaf3657cb44bf27dd84 to your computer and use it in GitHub Desktop.
componentDidMount: function() {
Api.getToken().then((response) => {
this.setState({
token: response.access_token,
});
}).then(()=>{
Api.getAllPosts(this.state.token,0).then((response)=> {
this.setState({
dataSource : this.state.dataSource.cloneWithRows(response.posts),
loaded : true
});
}).done();
}).done();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment