about summary refs log tree commit diff
path: root/app/assets/javascripts/components/selectors
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-27 21:59:56 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-27 21:59:56 +0200
commit1c84d505c8cb926710d059725c5a2d966dd4736b (patch)
treec4ff6e08948a6432ce8f966c4ba8b5d7e11adb28 /app/assets/javascripts/components/selectors
parent909d0d5e88b046f8bb69c893c54944bb2aad12cf (diff)
Adding following/followers lists to the UI
Diffstat (limited to 'app/assets/javascripts/components/selectors')
-rw-r--r--app/assets/javascripts/components/selectors/index.jsx16
1 files changed, 9 insertions, 7 deletions
diff --git a/app/assets/javascripts/components/selectors/index.jsx b/app/assets/javascripts/components/selectors/index.jsx
index b571e43d5..21ee96906 100644
--- a/app/assets/javascripts/components/selectors/index.jsx
+++ b/app/assets/javascripts/components/selectors/index.jsx
@@ -7,13 +7,15 @@ const getAccounts = state => state.getIn(['timelines', 'accounts']);
 const getAccountBase         = (state, id) => state.getIn(['timelines', 'accounts', id], null);
 const getAccountRelationship = (state, id) => state.getIn(['timelines', 'relationships', id]);
 
-export const getAccount = createSelector([getAccountBase, getAccountRelationship], (base, relationship) => {
-  if (base === null) {
-    return null;
-  }
+export const makeGetAccount = () => {
+  return createSelector([getAccountBase, getAccountRelationship], (base, relationship) => {
+    if (base === null) {
+      return null;
+    }
 
-  return base.set('relationship', relationship);
-});
+    return base.set('relationship', relationship);
+  });
+};
 
 const getStatusBase = (state, id) => state.getIn(['timelines', 'statuses', id], null);
 
@@ -65,7 +67,7 @@ export const getNotifications = createSelector([getNotificationsBase], (base) =>
   return arr;
 });
 
-const getSuggestionsBase = (state) => state.getIn(['timelines', 'suggestions']);
+const getSuggestionsBase = (state) => state.get('suggestions');
 
 export const getSuggestions = createSelector([getSuggestionsBase, getAccounts], (base, accounts) => {
   return base.map(accountId => accounts.get(accountId));