use makeMapStateToProps

th-downstream
cwm 7 years ago
parent d6ca0e29a7
commit 1dd4e3791f

@ -32,22 +32,26 @@ const messages = defineMessages({
misc: { id: 'navigation_bar.misc', defaultMessage: 'Misc' }, misc: { id: 'navigation_bar.misc', defaultMessage: 'Misc' },
}); });
const getOrderedLists = createSelector([state => state.get('lists')], lists => { const makeMapStateToProps = () => {
if (!lists) { const getOrderedLists = createSelector([state => state.get('lists')], lists => {
return lists; if (!lists) {
} return lists;
}
return lists.toList().filter(item => !!item).sort((a, b) => a.get('title').localeCompare(b.get('title'))); return lists.toList().filter(item => !!item).sort((a, b) => a.get('title').localeCompare(b.get('title')));
}); });
const mapStateToProps = state => ({ const mapStateToProps = state => ({
myAccount: state.getIn(['accounts', me]), lists: getOrderedLists(state),
columns: state.getIn(['settings', 'columns']), myAccount: state.getIn(['accounts', me]),
lists: getOrderedLists(state), columns: state.getIn(['settings', 'columns']),
}); });
return mapStateToProps;
}
@connect(mapStateToProps)
@injectIntl @injectIntl
@connect(makeMapStateToProps)
export default class GettingStarted extends ImmutablePureComponent { export default class GettingStarted extends ImmutablePureComponent {
static propTypes = { static propTypes = {

Loading…
Cancel
Save