defineLoad() {
    let arg1 = arguments[0];
    let arg2 = arguments[1];
    let arg3 = arguments[2];
    let state = 'afterLoad';
    let path = '/*';
    let handler = null;

    switch (arguments.length) {
      case 1:
        if (typeof arg1 !== 'function') throw new Error(`defineLoad() expects argument to be a function when only 1 argument is passed`);
        handler = arg1;
        break;
      case 2:
        if (typeof arg1 !== 'string' || typeof arg2 !== 'function') throw new Error(`defineLoad() expects first argument to be a load state/path and second argument to be a function`);
        if (arg1 === 'beforeLoad' || arg1 === 'loading' || arg1 !== 'afterLoad')
          state = arg1;
        else
          path = arg1;
        handler = arg2;
        break;
      case 3:
        if (typeof arg1 !== 'string' || typeof arg2 !== 'string' || typeof arg3 !== 'function') throw new Error(`defineLoad() expects first argument to be a load state, second argument to be a path, and third argument to be a function`);
        if (arg1 !== 'beforeLoad' && arg1 !== 'loading' && arg1 !== 'afterLoad') throw new Error(`Bad load state specified`);
        state = arg1;
        path = arg2;
        handler = arg3;
        break;
      default:
        throw new Error(`Invalid arguments passed into defineLoad()`);
    }

    this.initializers[state][PageManager.normalizePath(path, true)] = handler;
  }
/**
   * Defines handler that triggers before a page is fully loaded.
   *
   * @param {string|Function} - The meaning of this value depends on the number
   *                            of arguments passed into this method.
   *                            1. Handler invoked after every page load.
   *                            2. The path or load state this handler is
   *                               defined for. Load states are one of
   *                               'beforeLoad', 'loading', or 'afterLoad'.
   *                            3. The load state of the page of which the
   *                               handler should be invoked: 'beforeLoad',
   *                               'loading', or 'afterLoad'.
   * @param {string|Function} - The meaning of this value depends on the number
   *                            of arguments passed into this method.
   *                            2. Handler invoked at the specified state or
   *                               path of the page load.
   *                            3. The path this handler is defined for.
   * @param {Function} - Handler invoked at the specified state and path of the
   *                     page load.
   */
Defines handler that triggers before a page is fully loaded.
@param {string|Function} - The meaning of this value depends on the number
of arguments passed into this method.
1. Handler invoked after every page load.
2. The path or load state this handler is
defined for.
Defines handler that triggers before a page is fully loaded . @param { string|Function } - The meaning of this value depends on the number of arguments passed into this method . 1 . Handler invoked after every page load . 2 . The path or load state this handler is defined for .
defineLoad() {
    let arg1 = arguments[0];
    let arg2 = arguments[1];
    let arg3 = arguments[2];
    let state = 'afterLoad';
    let path = '/*';
    let handler = null;
    switch (arguments.length) {
      case 1:
        if (typeof arg1 !== 'function') throw new Error(`defineLoad() expects argument to be a function when only 1 argument is passed`);
        handler = arg1;
        break;
      case 2:
        if (typeof arg1 !== 'string' || typeof arg2 !== 'function') throw new Error(`defineLoad() expects first argument to be a load state/path and second argument to be a function`);
        if (arg1 === 'beforeLoad' || arg1 === 'loading' || arg1 !== 'afterLoad')
          state = arg1;
        else
          path = arg1;
        handler = arg2;
        break;
      case 3:
        if (typeof arg1 !== 'string' || typeof arg2 !== 'string' || typeof arg3 !== 'function') throw new Error(`defineLoad() expects first argument to be a load state, second argument to be a path, and third argument to be a function`);
        if (arg1 !== 'beforeLoad' && arg1 !== 'loading' && arg1 !== 'afterLoad') throw new Error(`Bad load state specified`);
        state = arg1;
        path = arg2;
        handler = arg3;
        break;
      default:
        throw new Error(`Invalid arguments passed into defineLoad()`);
    }
    this.initializers[state][PageManager.normalizePath(path, true)] = handler;
  }
defineLoad ( ) { let arg1 = arguments [ 0 ] ; let arg2 = arguments [ 1 ] ; let arg3 = arguments [ 2 ] ; let state = 'afterLoad' ; let path = '/*' ; let handler = null ; switch ( arguments . length ) { case 1 : if ( typeof arg1 !== 'function' ) throw new Error ( ` ` ) ; handler = arg1 ; break ; case 2 : if ( typeof arg1 !== 'string' || typeof arg2 !== 'function' ) throw new Error ( ` ` ) ; if ( arg1 === 'beforeLoad' || arg1 === 'loading' || arg1 !== 'afterLoad' ) state = arg1 ; else path = arg1 ; handler = arg2 ; break ; case 3 : if ( typeof arg1 !== 'string' || typeof arg2 !== 'string' || typeof arg3 !== 'function' ) throw new Error ( ` ` ) ; if ( arg1 !== 'beforeLoad' && arg1 !== 'loading' && arg1 !== 'afterLoad' ) throw new Error ( ` ` ) ; state = arg1 ; path = arg2 ; handler = arg3 ; break ; default : throw new Error ( ` ` ) ; } this . initializers [ state ] [ PageManager . normalizePath ( path , true ) ] = handler ; }
Defines handler that triggers before a page is fully loaded.
Defines handler that triggers before a page is fully loaded .