Cache subscription uris if we're gonna map it often.
This commit is contained in:
parent
91f1f588e6
commit
6b6879ba64
2 changed files with 7 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { MAX_LIVESTREAM_COMMENTS } from 'constants/livestream';
|
||||
import { selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import { selectSubscriptions } from 'redux/selectors/subscriptions';
|
||||
import { selectSubscriptionUris } from 'redux/selectors/subscriptions';
|
||||
import { withRouter } from 'react-router';
|
||||
import { makeSelectClaimForUri } from 'redux/selectors/claims';
|
||||
import { doResolveUris } from 'redux/actions/claims';
|
||||
|
@ -9,7 +9,7 @@ import { selectTopLevelCommentsForUri } from 'redux/selectors/comments';
|
|||
import ChannelMentionSuggestions from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
const subscriptionUris = selectSubscriptions(state).map(({ uri }) => uri);
|
||||
const subscriptionUris = selectSubscriptionUris(state);
|
||||
const topLevelComments = selectTopLevelCommentsForUri(
|
||||
state,
|
||||
props.uri,
|
||||
|
|
|
@ -20,6 +20,11 @@ export const selectSubscriptions = createSelector(
|
|||
(state) => state.subscriptions && state.subscriptions.sort((a, b) => a.channelName.localeCompare(b.channelName))
|
||||
);
|
||||
|
||||
export const selectSubscriptionUris = createSelector(
|
||||
selectSubscriptions,
|
||||
(subscriptions) => subscriptions && subscriptions.map((sub) => sub.uri)
|
||||
);
|
||||
|
||||
export const selectFollowing = createSelector(selectState, (state) => state.following && state.following);
|
||||
|
||||
// Fetching list of users subscriptions
|
||||
|
|
Loading…
Reference in a new issue