Quellcode durchsuchen

Removes redux compose utility function

master
yanas vor 8 Jahren
Ursprung
Commit
a59e691ba8
2 geänderte Dateien mit 10 neuen und 22 gelöschten Zeilen
  1. 0
    5
      flow-typed/npm/redux_v3.x.x.js
  2. 10
    17
      react/features/toolbox/actions.web.js

+ 0
- 5
flow-typed/npm/redux_v3.x.x.js Datei anzeigen

54
   declare function combineReducers<O: Object, A>(reducers: O): CombinedReducer<$ObjMap<O, <S>(r: Reducer<S, any>) => S>, A>;
54
   declare function combineReducers<O: Object, A>(reducers: O): CombinedReducer<$ObjMap<O, <S>(r: Reducer<S, any>) => S>, A>;
55
 
55
 
56
   declare function compose<S, A>(...fns: Array<StoreEnhancer<S, A>>): Function;
56
   declare function compose<S, A>(...fns: Array<StoreEnhancer<S, A>>): Function;
57
-
58
-  // Utility function in Redux that can be used for function composition
59
-  // e.g. bar(foo(baz)) is equivalent to compose(bar, foo)(baz).
60
-  declare function compose(...fns: Array<Function>): Function;
61
-
62
 }
57
 }

+ 10
- 17
react/features/toolbox/actions.web.js Datei anzeigen

1
 /* @flow */
1
 /* @flow */
2
 
2
 
3
-import { compose } from 'redux';
4
-
5
 import Recording from '../../../modules/UI/recording/Recording';
3
 import Recording from '../../../modules/UI/recording/Recording';
6
 import SideContainerToggler
4
 import SideContainerToggler
7
     from '../../../modules/UI/side_pannels/SideContainerToggler';
5
     from '../../../modules/UI/side_pannels/SideContainerToggler';
8
-import UIEvents from '../../../service/UI/UIEvents';
9
 import UIUtil from '../../../modules/UI/util/UIUtil';
6
 import UIUtil from '../../../modules/UI/util/UIUtil';
7
+import UIEvents from '../../../service/UI/UIEvents';
10
 
8
 
11
 import {
9
 import {
12
     changeLocalRaiseHand,
10
     changeLocalRaiseHand,
19
     toggleFullScreen,
17
     toggleFullScreen,
20
     toggleToolbarButton
18
     toggleToolbarButton
21
 } from './actions.native';
19
 } from './actions.native';
22
-
23
 import { SET_DEFAULT_TOOLBOX_BUTTONS } from './actionTypes';
20
 import { SET_DEFAULT_TOOLBOX_BUTTONS } from './actionTypes';
24
 import { getDefaultToolboxButtons } from './functions';
21
 import { getDefaultToolboxButtons } from './functions';
25
 
22
 
40
     return () => {
37
     return () => {
41
         // XXX Should use dispatcher to toggle screensharing but screensharing
38
         // XXX Should use dispatcher to toggle screensharing but screensharing
42
         // hasn't been React-ified yet.
39
         // hasn't been React-ified yet.
43
-
44
         if (UIUtil.isButtonEnabled('desktop')
40
         if (UIUtil.isButtonEnabled('desktop')
45
                 && config.autoEnableDesktopSharing) {
41
                 && config.autoEnableDesktopSharing) {
46
             APP.UI.eventEmitter.emit(UIEvents.TOGGLE_SCREENSHARING);
42
             APP.UI.eventEmitter.emit(UIEvents.TOGGLE_SCREENSHARING);
60
             return;
56
             return;
61
         }
57
         }
62
 
58
 
63
-        const state = getState();
64
-        const { timeoutMS, visible } = state['features/toolbox'];
59
+        const { timeoutMS, visible } = getState()['features/toolbox'];
65
 
60
 
66
         if (dock) {
61
         if (dock) {
67
             // First make sure the toolbox is shown.
62
             // First make sure the toolbox is shown.
89
  * @private
84
  * @private
90
  */
85
  */
91
 function _getButtonHandlers(dispatch, getState) {
86
 function _getButtonHandlers(dispatch, getState) {
92
-    const { isGuest } = getState()['features/jwt'];
93
-
94
-    const localRaiseHandHandler = compose(dispatch, changeLocalRaiseHand);
95
-    const toggleFullScreenHandler = compose(dispatch, toggleFullScreen);
87
+    const localRaiseHandHandler
88
+        = (...args) => dispatch(changeLocalRaiseHand(...args));
89
+    const toggleFullScreenHandler
90
+        = (...args) => dispatch(toggleFullScreen(...args));
96
 
91
 
97
     return {
92
     return {
98
         /**
93
         /**
127
          */
122
          */
128
         profile: {
123
         profile: {
129
             onMount: () =>
124
             onMount: () =>
130
-            isGuest
131
-            || dispatch(setProfileButtonUnclickable(true))
125
+                getState()['features/jwt']
126
+                    || dispatch(setProfileButtonUnclickable(true))
132
         },
127
         },
133
 
128
 
134
         /**
129
         /**
154
          */
149
          */
155
         recording: {
150
         recording: {
156
             onMount: () =>
151
             onMount: () =>
157
-            config.enableRecording
158
-            && dispatch(showRecordingButton())
152
+                config.enableRecording && dispatch(showRecordingButton())
159
         }
153
         }
160
     };
154
     };
161
 }
155
 }
366
  */
360
  */
367
 export function toggleSideToolbarContainer(containerId: string): Function {
361
 export function toggleSideToolbarContainer(containerId: string): Function {
368
     return (dispatch: Dispatch, getState: Function) => {
362
     return (dispatch: Dispatch, getState: Function) => {
369
-        const state = getState();
370
-        const { secondaryToolbarButtons } = state['features/toolbox'];
363
+        const { secondaryToolbarButtons } = getState()['features/toolbox'];
371
 
364
 
372
         for (const key of secondaryToolbarButtons.keys()) {
365
         for (const key of secondaryToolbarButtons.keys()) {
373
             const isButtonEnabled = UIUtil.isButtonEnabled(key);
366
             const isButtonEnabled = UIUtil.isButtonEnabled(key);

Laden…
Abbrechen
Speichern