Skip to content

Commit

Permalink
use destructuring for state
Browse files Browse the repository at this point in the history
  • Loading branch information
echenley committed Sep 13, 2015
1 parent 1420a5c commit 00ea545
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/js/views/Profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,13 @@ const Profile = React.createClass({
},

render() {
let user = this.state.user;
let profileData = this.state.profileData;
let { user, profileData, loading } = this.state;
let posts = profileData.posts;
let comments = profileData.comments;

let postList, commentList, postHeader, commentsHeader;

if (this.state.loading) {
if (loading) {
postHeader = <h2>Loading Posts...</h2>;
postList = <Spinner />;
commentsHeader = <h2>Loading Comments...</h2>;
Expand Down

0 comments on commit 00ea545

Please sign in to comment.