Skip to content

Conversation

Ashp1st
Copy link

@Ashp1st Ashp1st commented Oct 7, 2021

/*

  • Here we define the frequently accessed core classes of boilerplatejs. We are creating a object

  • that carry these classes as properties of it. This object is then used as a namespace when

  • accessing the core classes. This is a trick we use to aggregate classes under namespaces

  • since javascript has no formal way of grouping functions in to namespace.
    */
    define(function (require) {

    /*

    • Here you will notice we are not returning a function from this AMD module. We are returning a
    • plain javascript object with its properties holding references to core classes (functions).
    • We use 'require' function from requirejs inside the object to load appropriate core classes
    • from the respective AMD modules.
      /
      return {
      Context : require("./core/context"),
      DomController : require("./core/dom-controller"),
      UrlController : require("./core/url-controller"),
      UiPanel: require("./core/ui-panel")
      };
      /
  • Here we define the frequently accessed core classes of boilerplatejs. We are creating a object

  • that carry these classes as properties of it. This object is then used as a namespace when

  • accessing the core classes. This is a trick we use to aggregate classes under namespaces

  • since javascript has no formal way of grouping functions in to namespace.
    */
    define(function (require) {

    /*

    • Here you will notice we are not returning a function from this AMD module. We are returning a
    • plain javascript object with its properties holding references to core classes (functions).
    • We use 'require' function from requirejs inside the object to load appropriate core classes
    • from the respective AMD modules.
      */

    /**
    @type Script
    @namespace Boiler
    **/
    return {
    Context : require("./core/context"),
    DomController : require("./core/dom-controller"),
    UrlController : require("./core/url-controller"),
    UiPanel: require("./core/ui-panel")
    };
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants