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.
19 lines
684 B
JavaScript
19 lines
684 B
JavaScript
import { connect } from 'react-redux';
|
|
import { selectBalance } from 'redux/selectors/wallet';
|
|
import { makeSelectClaimForUri } from 'redux/selectors/claims';
|
|
import { doOpenModal } from 'redux/actions/app';
|
|
import WalletSend from './view';
|
|
import { withRouter } from 'react-router';
|
|
import { selectToast } from 'redux/selectors/notifications';
|
|
|
|
const perform = (dispatch) => ({
|
|
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
|
});
|
|
|
|
const select = (state, props) => ({
|
|
balance: selectBalance(state),
|
|
contentClaim: makeSelectClaimForUri(props.contentUri)(state),
|
|
snack: selectToast(state),
|
|
});
|
|
|
|
export default withRouter(connect(select, perform)(WalletSend));
|