lib/index.js
/**
 * create an object of executable hystrix commands
 * @param  {Object} hystrixFunctions Objetc of hystrix functions
 * @return {Object} of executable hystrix commands
 */
create an object of executable hystrix commands
@param  {Object} hystrixFunctions Objetc of hystrix functions
@return {Object} of executable hystrix commands
create an object of executable hystrix commands @param { Object } hystrixFunctions Objetc of hystrix functions @return { Object } of executable hystrix commands
function createExecutableCommands(hystrixFunctions, circuitBreakerImpl = DEFAULT_CIRCUIT_BREAKER) {
  const executeFunctions = {};
  const executeFns = Object.keys(hystrixFunctions);
  executeFns.forEach((fn) => {
    executeFunctions[fn] = async (...args) => {
      return circuitBreakerImpl === 'opossum'
        ? await hystrixFunctions[fn].fire(...args)
        : await hystrixFunctions[fn].exec(...args);
    };
  });
  return executeFunctions;
}
function createExecutableCommands ( hystrixFunctions , circuitBreakerImpl = DEFAULT_CIRCUIT_BREAKER ) { const executeFunctions = { } ; const executeFns = Object . keys ( hystrixFunctions ) ; executeFns . forEach ( ( fn ) => { executeFunctions [ fn ] = async ( ... args ) => { return circuitBreakerImpl === 'opossum' ? await hystrixFunctions [ fn ] . fire ( ... args ) : await hystrixFunctions [ fn ] . exec ( ... args ) ; } ; } ) ; return executeFunctions ; }
create an object of executable hystrix commands
 @param  {Object} hystrixFunctions Objetc of hystrix functions
 @return {Object} of executable hystrix commands
create an object of executable hystrix commands @param { Object } hystrixFunctions Objetc of hystrix functions @return { Object } of executable hystrix commands