mirror of
https://github.com/Unleash/unleash.git
synced 2025-10-27 11:02:16 +01:00
This feature enables overrides of certain UI elements from the API such as setting a different background color for the header. This will make it easier to customise the UI in different environemnt.
19 lines
508 B
JavaScript
19 lines
508 B
JavaScript
import api from '../../data/config-api';
|
|
import { dispatchAndThrow } from '../util';
|
|
|
|
export const RECEIVE_CONFIG = 'RECEIVE_CONFIG';
|
|
export const ERROR_RECEIVE_CONFIG = 'ERROR_RECEIVE_CONFIG';
|
|
|
|
export const receiveConfig = json => ({
|
|
type: RECEIVE_CONFIG,
|
|
value: json,
|
|
});
|
|
|
|
export function fetchUIConfig() {
|
|
return dispatch =>
|
|
api
|
|
.fetchConfig()
|
|
.then(json => dispatch(receiveConfig(json)))
|
|
.catch(dispatchAndThrow(dispatch, ERROR_RECEIVE_CONFIG));
|
|
}
|