Bläddra i källkod

Flow, coding style

master
Lyubo Marinov 8 år sedan
förälder
incheckning
da03b49754
1 ändrade filer med 23 tillägg och 19 borttagningar
  1. 23
    19
      react/features/base/jwt/reducer.js

+ 23
- 19
react/features/base/jwt/reducer.js Visa fil

1
+// @flow
2
+
1
 import { equals, set, ReducerRegistry } from '../redux';
3
 import { equals, set, ReducerRegistry } from '../redux';
2
 
4
 
3
 import { SET_CALL_OVERLAY_VISIBLE, SET_JWT } from './actionTypes';
5
 import { SET_CALL_OVERLAY_VISIBLE, SET_JWT } from './actionTypes';
7
  *
9
  *
8
  * @private
10
  * @private
9
  * @type {{
11
  * @type {{
12
+ *     callOverlayVisible: ?boolean
10
  *     isGuest: boolean
13
  *     isGuest: boolean
11
  * }}
14
  * }}
12
  */
15
  */
38
  * specified {@code action}.
41
  * specified {@code action}.
39
  */
42
  */
40
 ReducerRegistry.register(
43
 ReducerRegistry.register(
41
-'features/base/jwt', (state = _INITIAL_STATE, action) => {
42
-    switch (action.type) {
43
-    case SET_CALL_OVERLAY_VISIBLE:
44
-        return set(state, 'callOverlayVisible', action.callOverlayVisible);
45
-
46
-    case SET_JWT: {
47
-        // eslint-disable-next-line no-unused-vars
48
-        const { type, ...payload } = action;
49
-        const nextState = {
50
-            ..._INITIAL_STATE,
51
-            ...payload
52
-        };
53
-
54
-        return equals(state, nextState) ? state : nextState;
55
-    }
56
-    }
57
-
58
-    return state;
59
-});
44
+    'features/base/jwt',
45
+    (state = _INITIAL_STATE, action) => {
46
+        switch (action.type) {
47
+        case SET_CALL_OVERLAY_VISIBLE:
48
+            return set(state, 'callOverlayVisible', action.callOverlayVisible);
49
+
50
+        case SET_JWT: {
51
+            // eslint-disable-next-line no-unused-vars
52
+            const { type, ...payload } = action;
53
+            const nextState = {
54
+                ..._INITIAL_STATE,
55
+                ...payload
56
+            };
57
+
58
+            return equals(state, nextState) ? state : nextState;
59
+        }
60
+        }
61
+
62
+        return state;
63
+    });

Laddar…
Avbryt
Spara