Pārlūkot izejas kodu

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 gadus atpakaļ
vecāks
revīzija
2189ab7ee6

+ 3
- 2
react/features/conference/components/Conference.native.js Parādīt failu

@@ -229,11 +229,12 @@ class Conference extends Component {
229 229
  * Maps (parts of) the Redux state to the associated Conference's props.
230 230
  *
231 231
  * @param {Object} state - The Redux state.
232
+ * @private
232 233
  * @returns {{
233 234
  *     _passwordRequired: boolean
234 235
  * }}
235 236
  */
236
-function mapStateToProps(state) {
237
+function _mapStateToProps(state) {
237 238
     return {
238 239
         /**
239 240
          * The indicator which determines whether a password is required to join
@@ -255,4 +256,4 @@ function mapStateToProps(state) {
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 Parādīt failu

@@ -155,12 +155,13 @@ function _toBoolean(value, undefinedValue) {
155 155
  * @param {Object} state - The Redux state.
156 156
  * @param {Object} ownProps - The React Component props passed to the associated
157 157
  * (instance of) ParticipantView.
158
+ * @private
158 159
  * @returns {{
159 160
  *     _avatar: string,
160 161
  *     _videoTrack: Track
161 162
  * }}
162 163
  */
163
-function mapStateToProps(state, ownProps) {
164
+function _mapStateToProps(state, ownProps) {
164 165
     const participantId = ownProps.participantId;
165 166
     const participant
166 167
         = getParticipantById(
@@ -177,4 +178,4 @@ function mapStateToProps(state, ownProps) {
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 Parādīt failu

@@ -99,11 +99,12 @@ class FilmStrip extends Component {
99 99
  * Function that maps parts of Redux state tree into component props.
100 100
  *
101 101
  * @param {Object} state - Redux state.
102
+ * @private
102 103
  * @returns {{
103 104
  *      _participants: Participant[],
104 105
  *  }}
105 106
  */
106
-function mapStateToProps(state) {
107
+function _mapStateToProps(state) {
107 108
     return {
108 109
         /**
109 110
          * The participants in the conference.
@@ -115,4 +116,4 @@ function mapStateToProps(state) {
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 Parādīt failu

@@ -133,13 +133,14 @@ class Thumbnail extends Component {
133 133
  *
134 134
  * @param {Object} state - Redux state.
135 135
  * @param {Object} ownProps - Properties of component.
136
+ * @private
136 137
  * @returns {{
137 138
  *      _audioTrack: Track,
138 139
  *      _largeVideo: Object,
139 140
  *      _videoTrack: Track
140 141
  *  }}
141 142
  */
142
-function mapStateToProps(state, ownProps) {
143
+function _mapStateToProps(state, ownProps) {
143 144
     // We need read-only access to the state of features/large-video so that the
144 145
     // film strip doesn't render the video of the participant who is rendered on
145 146
     // the stage i.e. as a large video.
@@ -158,4 +159,4 @@ function mapStateToProps(state, ownProps) {
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 Parādīt failu

@@ -46,14 +46,15 @@ class LargeVideo extends Component {
46 46
  * Maps (parts of) the Redux state to the associated LargeVideo's props.
47 47
  *
48 48
  * @param {Object} state - Redux state.
49
+ * @private
49 50
  * @returns {{
50 51
  *     _participantId: string
51 52
  * }}
52 53
  */
53
-function mapStateToProps(state) {
54
+function _mapStateToProps(state) {
54 55
     return {
55 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 Parādīt failu

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

+ 2
- 2
react/features/toolbar/components/Toolbar.native.js Parādīt failu

@@ -6,7 +6,7 @@ import { MEDIA_TYPE, toggleCameraFacingMode } from '../../base/media';
6 6
 import { Container } from '../../base/react';
7 7
 import { ColorPalette } from '../../base/styles';
8 8
 
9
-import { AbstractToolbar, mapStateToProps } from './AbstractToolbar';
9
+import { AbstractToolbar, _mapStateToProps } from './AbstractToolbar';
10 10
 import { styles } from './styles';
11 11
 import ToolbarButton from './ToolbarButton';
12 12
 
@@ -160,4 +160,4 @@ Object.assign(Toolbar.prototype, {
160 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 Parādīt failu

@@ -124,11 +124,12 @@ class UnsupportedMobileBrowser extends Component {
124 124
  * props.
125 125
  *
126 126
  * @param {Object} state - Redux state.
127
+ * @private
127 128
  * @returns {{
128 129
  *     _room: string
129 130
  * }}
130 131
  */
131
-function mapStateToProps(state) {
132
+function _mapStateToProps(state) {
132 133
     return {
133 134
         /**
134 135
          * The name of the conference room to be joined upon clicking the
@@ -141,4 +142,4 @@ function mapStateToProps(state) {
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 Parādīt failu

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

+ 2
- 2
react/features/welcome/components/WelcomePage.native.js Parādīt failu

@@ -5,7 +5,7 @@ import { connect } from 'react-redux';
5 5
 import { Link } from '../../base/react';
6 6
 import { ColorPalette } from '../../base/styles';
7 7
 
8
-import { AbstractWelcomePage, mapStateToProps } from './AbstractWelcomePage';
8
+import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
9 9
 import { styles } from './styles';
10 10
 
11 11
 /**
@@ -125,4 +125,4 @@ class WelcomePage extends AbstractWelcomePage {
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 Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt