code: function safeInvokeForConfig({ fn, context, params, onNotInvoked }) {
      if (typeof fn === 'function') {
          let fnParams = params;
          if (typeof params === 'function') {
              fnParams = params();
          }
  
          // Warn if params or lazily evaluated params were given but not in an array
          if (fnParams != null && !Array.isArray(fnParams)) {
              if (process.env.NODE_ENV !== 'production') {
                  // eslint-disable-next-line no-console
                  console.warn("Params to pass into safeInvoke's fn is not an array. Ignoring...",
                               fnParams);
              }
  
              fnParams = null;
          }
  
          return {
              invoked: true,
              result: fn.apply(context, fnParams)
          };
      } else {
          if (typeof onNotInvoked === 'function') {
              onNotInvoked();
          }
  
          return { invoked: false };
      }
  }
docs: Abstraction for safeInvoke's two call signatures