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

This commit is contained in:
Leonard Kim 2019-06-23 07:44:22 -07:00 committed by virtuacoplenny
parent a1db63a8c2
commit 40c16f0bac
3 changed files with 17 additions and 4 deletions

View File

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

View File

@ -0,0 +1,16 @@
// @flow
import { StateListenerRegistry } from '../base/redux';
import { shouldDisplayTileView } from '../video-layout';
declare var APP: Object;
/**
* StateListenerRegistry provides a reliable way of detecting changes to
* preferred layout state and dispatching additional actions.
*/
StateListenerRegistry.register(
/* selector */ state => shouldDisplayTileView(state),
/* listener */ displayTileView => {
APP.API.notifyTileViewChanged(displayTileView);
});

View File

@ -36,10 +36,6 @@ StateListenerRegistry.register(
_updateAutoPinnedParticipant(store);
}
}
if (typeof APP === 'object') {
APP.API.notifyTileViewChanged(displayTileView);
}
}
);