web-installer/src/utils/helpers.js
/**
 * Helper function to reduce code duplication when removing a chain
 * and all it's data.
 * @param currentConfig is the current configuration of the chain
 * @param type this is the type of data we are going to be removing
 * @param removeDetails is the function which is used to remove the data source from the chain
 */
Helper function to reduce code duplication when removing a chain
and all it's data.
@param currentConfig is the current configuration of the chain
@param type this is the type of data we are going to be removing
@param removeDetails is the function which is used to remove the data source from the chain
Helper function to reduce code duplication when removing a chain and all it ' s data . @param currentConfig is the current configuration of the chain @param type this is the type of data we are going to be removing @param removeDetails is the function which is used to remove the data source from the chain
function clearDataSources(currentConfig, type, removeDataSourceDetails, payload) {
  for (let i = 0; i < currentConfig[type].length; i += 1) {
    payload.id = currentConfig[type][i];
    removeDataSourceDetails(payload);
  }
}
function clearDataSources ( currentConfig , type , removeDataSourceDetails , payload ) { for ( let i = 0 ; i < currentConfig [ type ] . length ; i += 1 ) { payload . id = currentConfig [ type ] [ i ] ; removeDataSourceDetails ( payload ) ; } }
Helper function to reduce code duplication when removing a chain
 and all it's data.
Helper function to reduce code duplication when removing a chain and all it ' s data .
// eslint-disable-next-line no-param-reassign