Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e10576e

Browse files
Fischer-LjasonLaster
authored andcommitted
4532 - Part 1: Update the mapDispatchToProps calls for Breakpoints.js, Popup.js, Preview/index.js (firefox-devtools#4640)
1 parent f1ff47b commit e10576e

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

src/components/Editor/Breakpoints.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44

55
// @flow
66
import { connect } from "react-redux";
7-
import { bindActionCreators } from "redux";
87
import React, { Component } from "react";
98

109
import Breakpoint from "./Breakpoint";
1110

12-
import actions from "../../actions";
1311
import { getSelectedSource } from "../../selectors";
1412
import getVisibleBreakpoints from "../../selectors/visibleBreakpoints";
1513
import { makeLocationId } from "../../utils/breakpoint";
@@ -64,5 +62,4 @@ export default connect(
6462
breakpoints: getVisibleBreakpoints(state),
6563
selectedSource: getSelectedSource(state)
6664
}),
67-
dispatch => bindActionCreators(actions, dispatch)
6865
)(Breakpoints);

src/components/Editor/Preview/Popup.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import React, { Component } from "react";
88
import { connect } from "react-redux";
9-
import { bindActionCreators } from "redux";
109
import { isEnabled } from "devtools-config";
1110

1211
import Reps from "devtools-reps";
@@ -237,9 +236,23 @@ export class Popup extends Component<Props> {
237236
}
238237
}
239238

239+
const {
240+
addExpression,
241+
selectSourceURL,
242+
selectSource,
243+
loadObjectProperties,
244+
openLink
245+
} = actions;
246+
240247
export default connect(
241248
state => ({
242249
loadedObjects: getLoadedObjects(state)
243250
}),
244-
dispatch => bindActionCreators(actions, dispatch)
251+
{
252+
addExpression,
253+
selectSourceURL,
254+
selectSource,
255+
loadObjectProperties,
256+
openLink
257+
}
245258
)(Popup);

src/components/Editor/Preview/index.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
44

55
import React, { PureComponent } from "react";
6-
import { bindActionCreators } from "redux";
76
import { connect } from "react-redux";
87
import { debounce } from "lodash";
98

@@ -124,12 +123,24 @@ class Preview extends PureComponent {
124123
}
125124
}
126125

126+
const {
127+
addExpression,
128+
loadObjectProperties,
129+
setPreview,
130+
clearPreview
131+
} = actions;
132+
127133
export default connect(
128134
state => ({
129135
preview: getPreview(state),
130136
selectedSource: getSelectedSource(state),
131137
linesInScope: getInScopeLines(state),
132138
selectedFrameVisible: isSelectedFrameVisible(state)
133139
}),
134-
dispatch => bindActionCreators(actions, dispatch)
140+
{
141+
addExpression,
142+
loadObjectProperties,
143+
setPreview,
144+
clearPreview
145+
}
135146
)(Preview);

0 commit comments

Comments
 (0)