var React = require('react'); var Reflux = require('reflux'); var _ = require('lodash'); var channelStore = require('../stores/channel'); var selectedTabStore = require('../stores/selectedTab'); var tabActions = require('../actions/tab'); var TabList = React.createClass({ mixins: [ Reflux.connect(channelStore, 'channels'), Reflux.connect(selectedTabStore, 'selectedTab') ], getInitialState: function() { return { channels: channelStore.getState(), selectedTab: selectedTabStore.getState() }; }, render: function() { var self = this; var tabs = _.map(this.state.channels, function(server, address) { var channels = _.map(server, function(channel, name) { return
{name}
; }); channels.unshift({address}
); return channels; }); return (