Skip to content

Commit 055899e

Browse files
author
Ray Schamp
committed
Explain mergeProps in HOCs
1 parent 1e086d9 commit 055899e

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

src/lib/hash-parser-hoc.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ const HashParserHOC = function (WrappedComponent) {
7979
const mapDispatchToProps = dispatch => ({
8080
setProjectId: projectId => dispatch(setProjectId(projectId))
8181
});
82+
// Allow incoming props to override redux-provided props. Used to mock in tests.
8283
const mergeProps = (stateProps, dispatchProps, ownProps) => Object.assign(
8384
{}, stateProps, dispatchProps, ownProps
8485
);

src/lib/project-fetcher-hoc.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ const ProjectFetcherHOC = function (WrappedComponent) {
126126
dispatch(onFetchedProjectData(projectData, loadingState)),
127127
setProjectId: projectId => dispatch(setProjectId(projectId))
128128
});
129+
// Allow incoming props to override redux-provided props. Used to mock in tests.
129130
const mergeProps = (stateProps, dispatchProps, ownProps) => Object.assign(
130131
{}, stateProps, dispatchProps, ownProps
131132
);

src/lib/vm-manager-hoc.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ const vmManagerHOC = function (WrappedComponent) {
104104
onLoadedProject: loadingState => dispatch(onLoadedProject(loadingState))
105105
});
106106

107+
// Allow incoming props to override redux-provided props. Used to mock in tests.
107108
const mergeProps = (stateProps, dispatchProps, ownProps) => Object.assign(
108109
{}, stateProps, dispatchProps, ownProps
109110
);

0 commit comments

Comments
 (0)