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

32 lines
573 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) {
2015-07-09 20:12:24 +00:00
template = template.locals({
Item: Item
});
2015-05-07 21:55:40 +00:00
var Component = React.createClass({
mixins: [Reflux.ListenerMixin],
componentDidMount: function() {
this.listenTo(buildsStore, this.updateItems);
},
updateItems: function(items) {
this.setState({items: items});
},
2015-07-09 20:12:24 +00:00
render: template,
2015-05-07 21:55:40 +00:00
getInitialState: function() {
return {
items: []
};
}
});
return Component;
});