0f1d4039a9
- selectMyChannelClaims depends on `byId`, which currently is always invalidated per update, so it is not memoized. - Most of the use-cases just needs the ID or the length of the array anyways, so avoid generating a Claim array (in selectMyChannelClaims) unnecessarily -- the client need to reduce it back down to IDs again :/ - The simpler boolean also removes the need to memoize the selector, which saves a bit of memory.
13 lines
550 B
JavaScript
13 lines
550 B
JavaScript
import { connect } from 'react-redux';
|
|
import { selectHasChannels, selectFetchingMyChannels } from 'redux/selectors/claims';
|
|
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
|
import { doSetActiveChannel } from 'redux/actions/app';
|
|
import CreatorDashboardPage from './view';
|
|
|
|
const select = (state) => ({
|
|
hasChannels: selectHasChannels(state),
|
|
fetchingChannels: selectFetchingMyChannels(state),
|
|
activeChannelClaim: selectActiveChannelClaim(state),
|
|
});
|
|
|
|
export default connect(select, { doSetActiveChannel })(CreatorDashboardPage);
|