dispatch/client/src/js/containers/App.js

24 lines
789 B
JavaScript
Raw Normal View History

2015-12-28 23:34:32 +00:00
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import App from 'components/App';
import { getConnected } from 'state/app';
2017-06-29 04:56:05 +00:00
import { getSortedChannels } from 'state/channels';
import { getSortedPrivateChats } from 'state/privateChats';
import { getServers } from 'state/servers';
import { getSelectedTab, select } from 'state/tab';
import { getShowTabList, hideMenu } from 'state/ui';
import { push } from 'util/router';
2015-12-28 23:34:32 +00:00
const mapState = createStructuredSelector({
2017-06-29 04:56:05 +00:00
channels: getSortedChannels,
2017-06-06 23:03:35 +00:00
connected: getConnected,
2017-06-29 04:56:05 +00:00
privateChats: getSortedPrivateChats,
servers: getServers,
showTabList: getShowTabList,
tab: getSelectedTab
});
2015-12-28 23:34:32 +00:00
2017-05-29 01:02:39 +00:00
const mapDispatch = { push, select, hideMenu };
export default connect(mapState, mapDispatch)(App);