packages/optimizely-sdk/lib/core/project_config/project_config_manager.js
function ProjectConfigManager(config) {
  try {
    this.__initialize(config);
  } catch (ex) {
    logger.error(ex);
    this.__updateListeners = [];
    this.__configObj = null;
    this.__readyPromise = Promise.resolve({
      success: false,
      reason: getErrorMessage(ex, 'Error in initialize'),
    });
  }
}
function ProjectConfigManager(config) {
  try {
    this.__initialize(config);
  } catch (ex) {
    logger.error(ex);
    this.__updateListeners = [];
    this.__configObj = null;
    this.__readyPromise = Promise.resolve({
      success: false,
      reason: getErrorMessage(ex, 'Error in initialize'),
    });
  }
}
function ProjectConfigManager ( config ) { try { this . __initialize ( config ) ; } catch ( ex ) { logger . error ( ex ) ; this . __updateListeners = [ ] ; this . __configObj = null ; this . __readyPromise = Promise . resolve ( { success : false , reason : getErrorMessage ( ex , 'Error in initialize' ) , } ) ; } }
ProjectConfigManager provides project config objects via its methods
getConfig and onUpdate. It uses a DatafileManager to fetch datafiles. It is
responsible for parsing and validating datafiles, and converting datafile
JSON objects into project config objects.
@param {Object}         config
@param {Object|string=} config.datafile
@param {Object=}        config.datafileOptions
@param {Object=}        config.jsonSchemaValidator
@param {string=}        config.sdkKey
@param {boolean=}       config.skipJSONValidation
ProjectConfigManager provides project config objects via its methods getConfig and onUpdate . It uses a DatafileManager to fetch datafiles . It is responsible for parsing and validating datafiles and converting datafile JSON objects into project config objects .