[RN] Detect errors when loading the configuration
The error is stored in the redux store in base/config so other components can consult it. It is also broadcasted as a new event in the external API for the SDK.
This commit is contained in:
committed by
Lyubo Marinov
parent
1d8ee9d32f
commit
284e4e543e
@@ -1,3 +1,14 @@
|
||||
/**
|
||||
* The redux action which signals the configuration couldn't be loaded due to an
|
||||
* error.
|
||||
*
|
||||
* {
|
||||
* type: LOAD_CONFIG_ERROR,
|
||||
* error: Error
|
||||
* }
|
||||
*/
|
||||
export const LOAD_CONFIG_ERROR = Symbol('LOAD_CONFIG_ERROR');
|
||||
|
||||
/**
|
||||
* The redux action which sets the configuration represented by the feature
|
||||
* base/config. The configuration is defined and consumed by the library
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
/* @flow */
|
||||
|
||||
import { SET_CONFIG } from './actionTypes';
|
||||
import { LOAD_CONFIG_ERROR, SET_CONFIG } from './actionTypes';
|
||||
|
||||
/**
|
||||
* Signals an error when loading the configuration.
|
||||
*
|
||||
* @param {Error} error - The error which caused the config to not be loaded.
|
||||
* @returns {{
|
||||
* type: LOAD_CONFIG_ERROR,
|
||||
* error: Error
|
||||
* }}
|
||||
*/
|
||||
export function loadConfigError(error: Error) {
|
||||
return {
|
||||
type: LOAD_CONFIG_ERROR,
|
||||
error
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the configuration represented by the feature base/config. The
|
||||
|
||||
Reference in New Issue
Block a user