mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-12 19:05:08 +00:00
30 lines
569 B
JavaScript
30 lines
569 B
JavaScript
|
'use strict';
|
||
|
|
||
|
define([
|
||
|
'react',
|
||
|
'reflux',
|
||
|
'app/stores/console',
|
||
|
'templates/app/components/console/console'
|
||
|
], function(React, Reflux, consoleStore, template) {
|
||
|
var Component = React.createClass({
|
||
|
mixins: [Reflux.ListenerMixin],
|
||
|
componentDidMount: function() {
|
||
|
this.listenTo(consoleStore, this.updateItems);
|
||
|
},
|
||
|
updateItems: function(data) {
|
||
|
this.setState({data: data});
|
||
|
},
|
||
|
render: function() {
|
||
|
return template(this.state.data);
|
||
|
},
|
||
|
getInitialState: function() {
|
||
|
return {
|
||
|
name: '',
|
||
|
data: ''
|
||
|
};
|
||
|
}
|
||
|
});
|
||
|
|
||
|
return Component;
|
||
|
});
|