more reformatting
This commit is contained in:
@@ -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()
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user