nci/static/js/app/components/projects/list.js

33 lines
610 B
JavaScript
Raw Normal View History

2015-05-03 23:04:51 +00:00
'use strict';
define([
'react',
'reflux',
'./item',
'app/stores/project',
'templates/app/components/projects/list'
], function(React, Reflux, Item, projectStore, template) {
var Component = React.createClass({
mixins: [Reflux.ListenerMixin],
componentDidMount: function() {
this.listenTo(projectStore, this.updateItems);
},
updateItems: function(items) {
this.setState({items: items});
},
render: function() {
return template({
Item: Item,
items: this.state.items
});
},
getInitialState: function() {
return {
items: []
};
}
});
return Component;
});