Browse Source

ref(api): move tile view subscriber to api dir

master
Leonard Kim 6 years ago
parent
commit
40c16f0bac

+ 1
- 0
react/features/external-api/index.js View File

@@ -1 +1,2 @@
1 1
 import './middleware';
2
+import './subscriber';

+ 16
- 0
react/features/external-api/subscriber.js View File

@@ -0,0 +1,16 @@
1
+// @flow
2
+
3
+import { StateListenerRegistry } from '../base/redux';
4
+import { shouldDisplayTileView } from '../video-layout';
5
+
6
+declare var APP: Object;
7
+
8
+/**
9
+ * StateListenerRegistry provides a reliable way of detecting changes to
10
+ * preferred layout state and dispatching additional actions.
11
+ */
12
+StateListenerRegistry.register(
13
+    /* selector */ state => shouldDisplayTileView(state),
14
+    /* listener */ displayTileView => {
15
+        APP.API.notifyTileViewChanged(displayTileView);
16
+    });

+ 0
- 4
react/features/video-layout/subscriber.js View File

@@ -36,10 +36,6 @@ StateListenerRegistry.register(
36 36
                 _updateAutoPinnedParticipant(store);
37 37
             }
38 38
         }
39
-
40
-        if (typeof APP === 'object') {
41
-            APP.API.notifyTileViewChanged(displayTileView);
42
-        }
43 39
     }
44 40
 );
45 41
 

Loading…
Cancel
Save