dispatch/client/js/state/selectors.js

12 lines
364 B
JavaScript
Raw Normal View History

import { createSelector } from 'reselect';
2018-04-25 03:36:27 +00:00
import get from 'lodash/get';
import { getServers } from './servers';
import { getSelectedTab } from './tab';
// eslint-disable-next-line import/prefer-default-export
export const getSelectedTabTitle = createSelector(
getSelectedTab,
getServers,
2018-04-25 03:36:27 +00:00
(tab, servers) => tab.name || get(servers, [tab.server, 'name'])
);