浏览代码

Consistent naming of react-redux's mapStateToProps

Until we make a decision on access modifier hints and adopt a respective
coding style, consistency is king.
master
Lyubomir Marinov 8 年前
父节点
当前提交
2189ab7ee6

+ 3
- 2
react/features/conference/components/Conference.native.js 查看文件

229
  * Maps (parts of) the Redux state to the associated Conference's props.
229
  * Maps (parts of) the Redux state to the associated Conference's props.
230
  *
230
  *
231
  * @param {Object} state - The Redux state.
231
  * @param {Object} state - The Redux state.
232
+ * @private
232
  * @returns {{
233
  * @returns {{
233
  *     _passwordRequired: boolean
234
  *     _passwordRequired: boolean
234
  * }}
235
  * }}
235
  */
236
  */
236
-function mapStateToProps(state) {
237
+function _mapStateToProps(state) {
237
     return {
238
     return {
238
         /**
239
         /**
239
          * The indicator which determines whether a password is required to join
240
          * The indicator which determines whether a password is required to join
255
     };
256
     };
256
 }
257
 }
257
 
258
 
258
-export default reactReduxConnect(mapStateToProps)(Conference);
259
+export default reactReduxConnect(_mapStateToProps)(Conference);

+ 3
- 2
react/features/conference/components/ParticipantView.native.js 查看文件

155
  * @param {Object} state - The Redux state.
155
  * @param {Object} state - The Redux state.
156
  * @param {Object} ownProps - The React Component props passed to the associated
156
  * @param {Object} ownProps - The React Component props passed to the associated
157
  * (instance of) ParticipantView.
157
  * (instance of) ParticipantView.
158
+ * @private
158
  * @returns {{
159
  * @returns {{
159
  *     _avatar: string,
160
  *     _avatar: string,
160
  *     _videoTrack: Track
161
  *     _videoTrack: Track
161
  * }}
162
  * }}
162
  */
163
  */
163
-function mapStateToProps(state, ownProps) {
164
+function _mapStateToProps(state, ownProps) {
164
     const participantId = ownProps.participantId;
165
     const participantId = ownProps.participantId;
165
     const participant
166
     const participant
166
         = getParticipantById(
167
         = getParticipantById(
177
     };
178
     };
178
 }
179
 }
179
 
180
 
180
-export default connect(mapStateToProps)(ParticipantView);
181
+export default connect(_mapStateToProps)(ParticipantView);

+ 3
- 2
react/features/film-strip/components/FilmStrip.js 查看文件

99
  * Function that maps parts of Redux state tree into component props.
99
  * Function that maps parts of Redux state tree into component props.
100
  *
100
  *
101
  * @param {Object} state - Redux state.
101
  * @param {Object} state - Redux state.
102
+ * @private
102
  * @returns {{
103
  * @returns {{
103
  *      _participants: Participant[],
104
  *      _participants: Participant[],
104
  *  }}
105
  *  }}
105
  */
106
  */
106
-function mapStateToProps(state) {
107
+function _mapStateToProps(state) {
107
     return {
108
     return {
108
         /**
109
         /**
109
          * The participants in the conference.
110
          * The participants in the conference.
115
     };
116
     };
116
 }
117
 }
117
 
118
 
118
-export default connect(mapStateToProps)(FilmStrip);
119
+export default connect(_mapStateToProps)(FilmStrip);

+ 3
- 2
react/features/film-strip/components/Thumbnail.js 查看文件

133
  *
133
  *
134
  * @param {Object} state - Redux state.
134
  * @param {Object} state - Redux state.
135
  * @param {Object} ownProps - Properties of component.
135
  * @param {Object} ownProps - Properties of component.
136
+ * @private
136
  * @returns {{
137
  * @returns {{
137
  *      _audioTrack: Track,
138
  *      _audioTrack: Track,
138
  *      _largeVideo: Object,
139
  *      _largeVideo: Object,
139
  *      _videoTrack: Track
140
  *      _videoTrack: Track
140
  *  }}
141
  *  }}
141
  */
142
  */
142
-function mapStateToProps(state, ownProps) {
143
+function _mapStateToProps(state, ownProps) {
143
     // We need read-only access to the state of features/large-video so that the
144
     // We need read-only access to the state of features/large-video so that the
144
     // film strip doesn't render the video of the participant who is rendered on
145
     // film strip doesn't render the video of the participant who is rendered on
145
     // the stage i.e. as a large video.
146
     // the stage i.e. as a large video.
158
     };
159
     };
159
 }
160
 }
160
 
161
 
161
-export default connect(mapStateToProps)(Thumbnail);
162
+export default connect(_mapStateToProps)(Thumbnail);

+ 3
- 2
react/features/large-video/components/LargeVideo.js 查看文件

46
  * Maps (parts of) the Redux state to the associated LargeVideo's props.
46
  * Maps (parts of) the Redux state to the associated LargeVideo's props.
47
  *
47
  *
48
  * @param {Object} state - Redux state.
48
  * @param {Object} state - Redux state.
49
+ * @private
49
  * @returns {{
50
  * @returns {{
50
  *     _participantId: string
51
  *     _participantId: string
51
  * }}
52
  * }}
52
  */
53
  */
53
-function mapStateToProps(state) {
54
+function _mapStateToProps(state) {
54
     return {
55
     return {
55
         _participantId: state['features/large-video'].participantId
56
         _participantId: state['features/large-video'].participantId
56
     };
57
     };
57
 }
58
 }
58
 
59
 
59
-export default connect(mapStateToProps)(LargeVideo);
60
+export default connect(_mapStateToProps)(LargeVideo);

+ 2
- 1
react/features/toolbar/components/AbstractToolbar.js 查看文件

138
  * Maps parts of media state to component props.
138
  * Maps parts of media state to component props.
139
  *
139
  *
140
  * @param {Object} state - Redux state.
140
  * @param {Object} state - Redux state.
141
+ * @protected
141
  * @returns {{
142
  * @returns {{
142
  *     _audioMuted: boolean,
143
  *     _audioMuted: boolean,
143
  *     _locked: boolean,
144
  *     _locked: boolean,
144
  *     _videoMuted: boolean
145
  *     _videoMuted: boolean
145
  * }}
146
  * }}
146
  */
147
  */
147
-export function mapStateToProps(state) {
148
+export function _mapStateToProps(state) {
148
     const conference = state['features/base/conference'];
149
     const conference = state['features/base/conference'];
149
     const media = state['features/base/media'];
150
     const media = state['features/base/media'];
150
 
151
 

+ 2
- 2
react/features/toolbar/components/Toolbar.native.js 查看文件

6
 import { Container } from '../../base/react';
6
 import { Container } from '../../base/react';
7
 import { ColorPalette } from '../../base/styles';
7
 import { ColorPalette } from '../../base/styles';
8
 
8
 
9
-import { AbstractToolbar, mapStateToProps } from './AbstractToolbar';
9
+import { AbstractToolbar, _mapStateToProps } from './AbstractToolbar';
10
 import { styles } from './styles';
10
 import { styles } from './styles';
11
 import ToolbarButton from './ToolbarButton';
11
 import ToolbarButton from './ToolbarButton';
12
 
12
 
160
     videoMutedIcon: 'camera-disabled'
160
     videoMutedIcon: 'camera-disabled'
161
 });
161
 });
162
 
162
 
163
-export default connect(mapStateToProps)(Toolbar);
163
+export default connect(_mapStateToProps)(Toolbar);

+ 3
- 2
react/features/unsupported-browser/components/UnsupportedMobileBrowser.js 查看文件

124
  * props.
124
  * props.
125
  *
125
  *
126
  * @param {Object} state - Redux state.
126
  * @param {Object} state - Redux state.
127
+ * @private
127
  * @returns {{
128
  * @returns {{
128
  *     _room: string
129
  *     _room: string
129
  * }}
130
  * }}
130
  */
131
  */
131
-function mapStateToProps(state) {
132
+function _mapStateToProps(state) {
132
     return {
133
     return {
133
         /**
134
         /**
134
          * The name of the conference room to be joined upon clicking the
135
          * The name of the conference room to be joined upon clicking the
141
     };
142
     };
142
 }
143
 }
143
 
144
 
144
-export default connect(mapStateToProps)(UnsupportedMobileBrowser);
145
+export default connect(_mapStateToProps)(UnsupportedMobileBrowser);

+ 2
- 1
react/features/welcome/components/AbstractWelcomePage.js 查看文件

201
  * to be used in child classes for 'connect'.
201
  * to be used in child classes for 'connect'.
202
  *
202
  *
203
  * @param {Object} state - Redux state.
203
  * @param {Object} state - Redux state.
204
+ * @protected
204
  * @returns {{
205
  * @returns {{
205
  *     _localVideoTrack: (Track|undefined),
206
  *     _localVideoTrack: (Track|undefined),
206
  *     _room: string
207
  *     _room: string
207
  * }}
208
  * }}
208
  */
209
  */
209
-export function mapStateToProps(state) {
210
+export function _mapStateToProps(state) {
210
     const conference = state['features/base/conference'];
211
     const conference = state['features/base/conference'];
211
     const tracks = state['features/base/tracks'];
212
     const tracks = state['features/base/tracks'];
212
 
213
 

+ 2
- 2
react/features/welcome/components/WelcomePage.native.js 查看文件

5
 import { Link } from '../../base/react';
5
 import { Link } from '../../base/react';
6
 import { ColorPalette } from '../../base/styles';
6
 import { ColorPalette } from '../../base/styles';
7
 
7
 
8
-import { AbstractWelcomePage, mapStateToProps } from './AbstractWelcomePage';
8
+import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
9
 import { styles } from './styles';
9
 import { styles } from './styles';
10
 
10
 
11
 /**
11
 /**
125
     }
125
     }
126
 }
126
 }
127
 
127
 
128
-export default connect(mapStateToProps)(WelcomePage);
128
+export default connect(_mapStateToProps)(WelcomePage);

+ 2
- 2
react/features/welcome/components/WelcomePage.web.js 查看文件

5
 
5
 
6
 import { Watermarks } from '../../base/react';
6
 import { Watermarks } from '../../base/react';
7
 
7
 
8
-import { AbstractWelcomePage, mapStateToProps } from './AbstractWelcomePage';
8
+import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
9
 
9
 
10
 /* eslint-disable require-jsdoc */
10
 /* eslint-disable require-jsdoc */
11
 
11
 
267
     }
267
     }
268
 }
268
 }
269
 
269
 
270
-export default connect(mapStateToProps)(WelcomePage);
270
+export default connect(_mapStateToProps)(WelcomePage);

正在加载...
取消
保存