about summary refs log tree commit diff
path: root/app/assets/javascripts/components/features/account
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-08 00:01:22 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-08 00:01:22 +0200
commitef9d4f4e0615bcc42528e2e73ade0ba02baa3ed9 (patch)
treef3e90eab6ebae1ba4b1061362e91f98dda2dc5bc /app/assets/javascripts/components/features/account
parent1f650d327d35bc48b897da99914c43750d8e5fd3 (diff)
Use reselect to memoize denormalization in UI state
Also upgrade react-redux to latest version. This is a performance update
Diffstat (limited to 'app/assets/javascripts/components/features/account')
-rw-r--r--app/assets/javascripts/components/features/account/index.jsx14
1 files changed, 5 insertions, 9 deletions
diff --git a/app/assets/javascripts/components/features/account/index.jsx b/app/assets/javascripts/components/features/account/index.jsx
index 9c77214d1..21aa8c5d6 100644
--- a/app/assets/javascripts/components/features/account/index.jsx
+++ b/app/assets/javascripts/components/features/account/index.jsx
@@ -20,22 +20,18 @@ import {
 }                            from '../../actions/interactions';
 import Header                from './components/header';
 import {
-  selectStatus,
-  selectAccount
-}                            from '../../reducers/timelines';
+  getAccountTimeline,
+  getAccount
+}                            from '../../selectors';
 import StatusList            from '../../components/status_list';
 import LoadingIndicator      from '../../components/loading_indicator';
 import Immutable             from 'immutable';
 import ActionBar             from './components/action_bar';
 import Column                from '../ui/components/column';
 
-function selectStatuses(state, accountId) {
-  return state.getIn(['timelines', 'accounts_timelines', accountId], Immutable.List([])).map(id => selectStatus(state, id)).filterNot(status => status === null);
-};
-
 const mapStateToProps = (state, props) => ({
-  account: selectAccount(state, Number(props.params.accountId)),
-  statuses: selectStatuses(state, Number(props.params.accountId)),
+  account: getAccount(state, Number(props.params.accountId)),
+  statuses: getAccountTimeline(state, Number(props.params.accountId)),
   me: state.getIn(['timelines', 'me'])
 });