Lyubo Marinov 92e765ea21 Introduce features/base/config
The config object defined by lib-jitsi-meet is not used by
lib-jitsi-meet only, jitsi-meet respects its values as well.
Moreover, jitsi-meet defined classes and/or functions which manipulate
that config object. Consequently, it makes sense to move the config
object and the associated classes and functions in a dedicated feature.
2017-04-23 15:18:41 -05:00

48 lines
1004 B
JavaScript

import { ReducerRegistry } from '../redux';
import {
LIB_DID_DISPOSE,
LIB_DID_INIT,
LIB_INIT_ERROR,
SET_WEBRTC_READY
} from './actionTypes';
/**
* The initial state of the feature base/lib-jitsi-meet.
*
* @type {Object}
*/
const INITIAL_STATE = {};
ReducerRegistry.register(
'features/base/lib-jitsi-meet',
(state = INITIAL_STATE, action) => {
switch (action.type) {
case LIB_DID_DISPOSE:
return INITIAL_STATE;
case LIB_DID_INIT:
return {
...state,
initError: undefined,
initialized: true
};
case LIB_INIT_ERROR:
return {
...state,
initError: action.error,
initialized: false
};
case SET_WEBRTC_READY:
return {
...state,
webRTCReady: action.webRTCReady
};
default:
return state;
}
});