Skip to content

Latest commit

 

History

History
98 lines (64 loc) · 3.57 KB

laxar.md

File metadata and controls

98 lines (64 loc) · 3.57 KB

laxar

The API entry point for boostrapping LaxarJS applications. Also, provides a couple of utilities to deal with assertions, objects and strings.

Contents

Types

Types

laxar

laxar.create( adapters, artifacts, configuration )

Prepares a LaxarJS application instance from a list of adapters, a bundle of artifacts, and application configuration. The instance then allows to configure which DOM node should receive an application flow. Running this has no effect until .bootstrap() is called on the returned instance API.

Parameters
Property Type Description
adapters Array widget adapters to use in this bootstrapping instance
artifacts Object an artifact listing for the application, generated by the utilized built tool (e.g. webpack)
configuration Object application-wide LaxarJS configuration. See http://laxarjs.org/docs/laxar-latest/manuals/configuration/ for further information on available properties
Returns
Type Description
BootstrappingInstance a handle on the bootstrapping instance, to load and bootstrap a flow

laxar.instances( optionalName )

Provide tooling access to LaxarJS services.

Each laxar#bootstrap call creates a new set of services such as a logger, global event bus etc. For tools like the laxar-developer-tools-widget, it may be necessary to access these services for a given instance, or for all instances.

Parameters
Property Type Description
optionalName String The configuration name of a LaxarJS instance to inspect. May be omitted to access all application instances by name.
Returns
Type Description
Object The tooling services for a specified instance, or for all instances that have tooling enabled.

BootstrappingInstance

Handle on a LaxarJS bootstrapping instance.

BootstrappingInstance.flow( name, anchorElement )

Registers a flow to control routing for this application.

Parameters
Property Type Description
name String widget adapters to use in this bootstrapping instance
anchorElement HTMLElement container element to determine where to put the flow
Returns
Type Description
BootstrappingInstance the current bootstrapping instance (self), for chaining

BootstrappingInstance.testing()

Declare that this instance is used for testing. This will cause .bootstrap not to fail if no flow was configured.

Returns
Type Description
BootstrappingInstance the current bootstrapping instance (self), for chaining

BootstrappingInstance.bootstrap()

Performs the actual application bootstrapping. This includes bootstrapping the application adapters and starting the router.