2022-09-27 07:42:30 +00:00
|
|
|
import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
|
|
|
|
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
|
2018-03-07 15:19:01 +00:00
|
|
|
|
2022-09-27 07:42:30 +00:00
|
|
|
import statsEmitter from './statsEmitter';
|
2018-03-07 15:19:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements the middleware of the feature connection-indicator.
|
|
|
|
*
|
|
|
|
* @param {Store} store - The redux store.
|
|
|
|
* @returns {Function}
|
|
|
|
*/
|
2022-09-27 07:42:30 +00:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2018-03-07 15:19:01 +00:00
|
|
|
MiddlewareRegistry.register(store => next => action => {
|
|
|
|
switch (action.type) {
|
|
|
|
case CONFERENCE_JOINED: {
|
|
|
|
statsEmitter.startListeningForStats(action.conference);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return next(action);
|
|
|
|
});
|
|
|
|
|