Fix StatusList memoization
This commit is contained in:
parent
8961fc1b68
commit
352c87c3b7
|
@ -21,18 +21,23 @@ const makeGetStatusIds = () => createSelector([
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapStateToProps = (state, { timelineId }) => {
|
const makeMapStateToProps = () => {
|
||||||
const lastStatusId = state.getIn(['timelines', timelineId, 'items'], ImmutableList()).last();
|
|
||||||
const getStatusIds = makeGetStatusIds();
|
const getStatusIds = makeGetStatusIds();
|
||||||
|
|
||||||
return {
|
const mapStateToProps = (state, { timelineId }) => {
|
||||||
statusIds: getStatusIds(state, { type: timelineId }),
|
const lastStatusId = state.getIn(['timelines', timelineId, 'items'], ImmutableList()).last();
|
||||||
lastStatusId: lastStatusId,
|
|
||||||
isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true),
|
return {
|
||||||
isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false),
|
statusIds: getStatusIds(state, { type: timelineId }),
|
||||||
hasMore: state.getIn(['timelines', timelineId, 'hasMore']),
|
lastStatusId: lastStatusId,
|
||||||
totalQueuedItemsCount: state.getIn(['timelines', timelineId, 'totalQueuedItemsCount']),
|
isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true),
|
||||||
|
isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false),
|
||||||
|
hasMore: state.getIn(['timelines', timelineId, 'hasMore']),
|
||||||
|
totalQueuedItemsCount: state.getIn(['timelines', timelineId, 'totalQueuedItemsCount']),
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return mapStateToProps;
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch, ownProps) => ({
|
const mapDispatchToProps = (dispatch, ownProps) => ({
|
||||||
|
@ -47,4 +52,4 @@ const mapDispatchToProps = (dispatch, ownProps) => ({
|
||||||
}, 100),
|
}, 100),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(StatusList);
|
export default connect(makeMapStateToProps, mapDispatchToProps)(StatusList);
|
||||||
|
|
Loading…
Reference in New Issue