Class: AvenxApp

AvenxApp(config)

The main application class for Avenx. Manages component registration, bridge registration, and mounting.

Constructor

new AvenxApp(config)

Parameters:
Name Type Description
config Object

Application configuration.

Properties
Name Type Description
target string

Selector for the main application container.

Source:

Classes

AvenxApp

Members

bridges :Object

Type:
  • Object
Source:

components

Source:

pages

Source:

router :AvenxRouter|null

Type:
Source:

Methods

initRouter(routes) → {AvenxRouter}

Initializes the router for the application.

Parameters:
Name Type Description
routes Object.<string, string>

Route mapping.

Source:
Returns:

The router instance.

Type
AvenxRouter

mount(name, targetSelectoropt)

Mounts a component to a target element.

Parameters:
Name Type Attributes Default Description
name string

The name of the component to mount.

targetSelector string | null <optional>
null

Optional selector for the mount target.

Source:

mountPage(name, paramsopt)

Mounts a page to the main application container.

Parameters:
Name Type Attributes Default Description
name string

The name of the page to mount.

params Object <optional>
{}

Dynamic route parameters to inject.

Source:

register(name, compClass)

Registers a component with the application.

Parameters:
Name Type Description
name string

The name of the component.

compClass
Source:

registerBridge(name, bridgeData)

Registers a bridge with the application. Bridges provide shared state and logic across components.

Parameters:
Name Type Description
name string

The name of the bridge.

bridgeData Object | function

The bridge data or constructor.

Source:

registerPage(name, pageClass)

Registers a page with the application.

Parameters:
Name Type Description
name string

The name of the page.

pageClass
Source:

updateAll()

Updates all active components in the application.

Source: