From ef9d4f4e0615bcc42528e2e73ade0ba02baa3ed9 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 8 Oct 2016 00:01:22 +0200 Subject: Use reselect to memoize denormalization in UI state Also upgrade react-redux to latest version. This is a performance update --- .../javascripts/components/reducers/timelines.jsx | 26 ---------------------- 1 file changed, 26 deletions(-) (limited to 'app/assets/javascripts/components/reducers') diff --git a/app/assets/javascripts/components/reducers/timelines.jsx b/app/assets/javascripts/components/reducers/timelines.jsx index 0b02ac181..927ac28fd 100644 --- a/app/assets/javascripts/components/reducers/timelines.jsx +++ b/app/assets/javascripts/components/reducers/timelines.jsx @@ -40,32 +40,6 @@ const initialState = Immutable.Map({ relationships: Immutable.Map() }); -export function selectStatus(state, id) { - let status = state.getIn(['timelines', 'statuses', id], null); - - if (status === null) { - return null; - } - - status = status.set('account', selectAccount(state, status.get('account'))); - - if (status.get('reblog') !== null) { - status = status.set('reblog', selectStatus(state, status.get('reblog'))); - } - - return status; -}; - -export function selectAccount(state, id) { - let account = state.getIn(['timelines', 'accounts', id], null); - - if (account === null) { - return null; - } - - return account.set('relationship', state.getIn(['timelines', 'relationships', id])); -}; - function normalizeStatus(state, status) { // Separate account let account = status.get('account'); -- cgit