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

33 lines
604 B
JavaScript
Raw Normal View History

2015-05-07 21:55:40 +00:00
'use strict';
define([
'react',
'reflux',
'./item',
'app/stores/builds',
'templates/app/components/builds/list'
], function(React, Reflux, Item, buildsStore, template) {
var Component = React.createClass({
mixins: [Reflux.ListenerMixin],
componentDidMount: function() {
this.listenTo(buildsStore, 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;
});