caf_components/main

Main package module.

Source:

Methods

load($, specopt, resourceName, modules, staticArtifactsopt, cbopt) → {Promise.<Object>|null}

Source:

Creates and initializes a hierarchy of asynchronous components.

Parameters:
Name Type Attributes Description
$ null | ctxType

A context for the top level component. If null a new one is created. Otherwise, it should be a properly initialized context, i.e., with top level objects $._ and $._.$.

spec specDeltaType <optional>

Extra configuration data that will be merged with the resource description. For example, to override the default name of the top component use {name: "foo"}.

resourceName string

The name of a component description file.

modules null | Array.<Object>

A sequence of modules to load descriptions and implementations (see module:caf_components/gen_loader). Use null to avoid modifying the current loader configuration.

staticArtifacts Object.<string, Object> <optional>

An optional collection of already loaded modules and files.

cb cbType <optional>

An optional callback to return context $ with the new top level component or an error. If missing, it returns a Promise with the context.

Returns:

A promise with the $ context or null if a callback is provided.

Type
Promise.<Object> | null