index.js
function make(component, config) {
    var Constructor, Subclass,
      conf = config || {};

    // Config exists as a way to create pass a set of derived options. In the original use case a function was created
    // to parse the DOM and pass information to the component at the time of creation.
    // Allow the $el to be passed directly as part of component instead of with the configuration.
    if (component.$el && !conf.$el) {
      conf.$el = component.$el;
    }

    Constructor = Component.subclass(new ApiInstance());


    if (!subclasses[component.name]) {
      // Cache initialized subclasses so we can reuse them with custom configuration.
      subclasses[component.name] = Constructor.subclass(component);
    }

    // Create the subclass constructor
    Subclass = subclasses[component.name].subclass(conf);


    // Return an instance
    return new Subclass();
  }
function make(component, config) {
    var Constructor, Subclass,
      conf = config || {};

    // Config exists as a way to create pass a set of derived options. In the original use case a function was created
    // to parse the DOM and pass information to the component at the time of creation.
    // Allow the $el to be passed directly as part of component instead of with the configuration.
    if (component.$el && !conf.$el) {
      conf.$el = component.$el;
    }

    Constructor = Component.subclass(new ApiInstance());


    if (!subclasses[component.name]) {
      // Cache initialized subclasses so we can reuse them with custom configuration.
      subclasses[component.name] = Constructor.subclass(component);
    }

    // Create the subclass constructor
    Subclass = subclasses[component.name].subclass(conf);


    // Return an instance
    return new Subclass();
  }
function make ( component , config ) { var Constructor , Subclass , conf = config || { } ; // Config exists as a way to create pass a set of derived options. In the original use case a function was created // to parse the DOM and pass information to the component at the time of creation. // Allow the $el to be passed directly as part of component instead of with the configuration. if ( component . $el && ! conf . $el ) { conf . $el = component . $el ; } Constructor = Component . subclass ( new ApiInstance ( ) ) ; if ( ! subclasses [ component . name ] ) { // Cache initialized subclasses so we can reuse them with custom configuration. subclasses [ component . name ] = Constructor . subclass ( component ) ; } // Create the subclass constructor Subclass = subclasses [ component . name ] . subclass ( conf ) ; // Return an instance return new Subclass ( ) ; }
Important to note that the components which are initialized, inherit the same event emitter. this enables all components of the same type to listen to events. As the emitter is intended to listen to application level events, it makes sense to me that all instances would respond to the event
Important to note that the components which are initialized inherit the same event emitter . this enables all components of the same type to listen to events . As the emitter is intended to listen to application level events it makes sense to me that all instances would respond to the event