Namespace pattern for Apps Script - Bruce McPherson

PHOTO EMBED

Sun Jun 13 2021 05:34:15 GMT+0000 (UTC)

Saved by @dsottimano

const Main = ( () => {
  const ca ='public';
  const cb ='private';
  
  // we'll export this function
  const fa = () => `${ca}:${cb}`;
  
  // but not these
  const fb = () => fa();
  const fc = () => fb();
  
  // this is a little like export
  // just expose the things you want public
  return {
    fa,
    ca
  };
})();
content_copyCOPY

https://ramblings.mcpher.com/gassnippets2/improved-namespace-pattern-for-apps-script/