more reformatting

This commit is contained in:
Edin Dazdarevic
2015-01-25 16:42:16 +01:00
parent e3997a1a48
commit 0abbdcec1f
5 changed files with 59 additions and 58 deletions

View File

@@ -6,30 +6,30 @@ var ItemCollection = require('../../models/itemCollection');
var AllItems = React.createClass({
render: function() {
if(this.state) {
return (
<ItemList items={this.state.items} />
render: function() {
if(this.state) {
return (
<ItemList items={this.state.items} />
);
}
else {
return (
<div> Not Loaded ! </div>
return (
<div> Not Loaded ! </div>
);
}
},
// Add change listeners to stores
},
// Add change listeners to stores
componentDidMount: function() {
ItemActions.loadFrontPageItems();
ItemStore.addChangeListener(this._onChange);
ItemActions.loadFrontPageItems();
ItemStore.addChangeListener(this._onChange);
},
_onChange: function () {
if (this.isMounted()) {
this.setState({
items: ItemStore.getItems()
items: ItemStore.getItems()
});
}
},