Source

externalCode/appIndex.js

/**
 * @class
 * App Root JavaScript Hooks.
 * Instance name: indexJsApi
 
   It can be used to register functions that require initialization in index.js. 
 * @example
 * externalCodeSetup.indexJsApi.METHOD_NAME
 */
export class IndexJsApi {
	/**
	 * @private
	 * @property {Function[]} indexJsFunctions
	 */
	indexJsFunctions = [];

	/**
	 * Registers a function to be called after a bug tracking tool initializes but before the main component is imported.
	 * It can be useful for registering third-party components that require initialization in index.js.
	 * @method
	 * @param {Function} fn
	 * @example
	 * externalCodeSetup.indexJsApi.addIndexJsFunction(() => {
	 *   console.log("function from external set up");
	 * })
	 */
	addIndexJsFunction = fn => {
		this.indexJsFunctions.push(fn);
	};
}