jiti-meet/react/features/base/config/actions.js

44 lines
1.1 KiB
JavaScript
Raw Normal View History

/* @flow */
import { LOAD_CONFIG_ERROR, SET_CONFIG } from './actionTypes';
/**
* Signals that a configuration could not be loaded due to a specific error.
*
* @param {Error} error - The {@code Error} which prevented the successful
* loading of a configuration.
* @param {string|URL} locationURL - The URL of the location which necessitated
* the loading of a configuration.
* @returns {{
* type: LOAD_CONFIG_ERROR,
* error: Error,
* locationURL
* }}
*/
export function loadConfigError(error: Error, locationURL: string | URL) {
return {
type: LOAD_CONFIG_ERROR,
error,
locationURL
};
}
/**
* Sets the configuration represented by the feature base/config. The
* configuration is defined and consumed by the library lib-jitsi-meet but some
* of its properties are consumed by the application jitsi-meet as well.
*
* @param {Object} config - The configuration to be represented by the feature
* base/config.
* @returns {{
* type: SET_CONFIG,
* config: Object
* }}
*/
export function setConfig(config: Object = {}) {
return {
type: SET_CONFIG,
config
};
}