diff options
author | cwm <chriswmartin@protonmail.com> | 2017-12-17 22:00:25 -0600 |
---|---|---|
committer | cwm <chriswmartin@protonmail.com> | 2017-12-17 22:00:25 -0600 |
commit | be50e45a74dfb12b00f8bd4d9ad34109c602b0cb (patch) | |
tree | 5a71645c4860d255ae9c37c1ead1baa850162689 /app/javascript | |
parent | e4ebbf4f07c55868dbe4fcf6a7074771b69f8e29 (diff) |
use makeMapStateToProps
Diffstat (limited to 'app/javascript')
-rw-r--r-- | app/javascript/flavours/glitch/features/getting_started/index.js | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/app/javascript/flavours/glitch/features/getting_started/index.js b/app/javascript/flavours/glitch/features/getting_started/index.js index 9782d4d32..ed9d9d1a0 100644 --- a/app/javascript/flavours/glitch/features/getting_started/index.js +++ b/app/javascript/flavours/glitch/features/getting_started/index.js @@ -32,22 +32,26 @@ const messages = defineMessages({ misc: { id: 'navigation_bar.misc', defaultMessage: 'Misc' }, }); -const getOrderedLists = createSelector([state => state.get('lists')], lists => { - if (!lists) { - return lists; - } +const makeMapStateToProps = () => { + const getOrderedLists = createSelector([state => state.get('lists')], 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 => ({ - myAccount: state.getIn(['accounts', me]), - columns: state.getIn(['settings', 'columns']), - lists: getOrderedLists(state), -}); + const mapStateToProps = state => ({ + lists: getOrderedLists(state), + myAccount: state.getIn(['accounts', me]), + columns: state.getIn(['settings', 'columns']), + }); + + return mapStateToProps; +} -@connect(mapStateToProps) @injectIntl +@connect(makeMapStateToProps) export default class GettingStarted extends ImmutablePureComponent { static propTypes = { |