Kaynağa Gözat

Flow, coding style

j8
Lyubo Marinov 8 yıl önce
ebeveyn
işleme
da03b49754
1 değiştirilmiş dosya ile 23 ekleme ve 19 silme
  1. 23
    19
      react/features/base/jwt/reducer.js

+ 23
- 19
react/features/base/jwt/reducer.js Dosyayı Görüntüle

@@ -1,3 +1,5 @@
1
+// @flow
2
+
1 3
 import { equals, set, ReducerRegistry } from '../redux';
2 4
 
3 5
 import { SET_CALL_OVERLAY_VISIBLE, SET_JWT } from './actionTypes';
@@ -7,6 +9,7 @@ import { SET_CALL_OVERLAY_VISIBLE, SET_JWT } from './actionTypes';
7 9
  *
8 10
  * @private
9 11
  * @type {{
12
+ *     callOverlayVisible: ?boolean
10 13
  *     isGuest: boolean
11 14
  * }}
12 15
  */
@@ -38,22 +41,23 @@ const _INITIAL_STATE = {
38 41
  * specified {@code action}.
39 42
  */
40 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
+    });

Loading…
İptal
Kaydet