Home Reference Source
import LifePod from 'incarnate/src/LifePod.jsx'
public class | source

LifePod

Extends:

src/HashMatrix.js~HashMatrix → LifePod

A container used to resolve a DependencyDeclaration.

See:

Static Member Summary

Static Public Members
public static
public static

Constructor Summary

Public Constructor
public

constructor(dependencyDeclaration: DependencyDeclaration)

Member Summary

Public Members
public
public
public
public
public get

dependencies: Object<HashMatrix>: *

public set

dependencies(value: Object<HashMatrix>)

public

factory(dependencyValues: DependencyDeclaration): * | Promise: Function

The factory function used to create the value of the dependency.

public

getters: Object<Function>

A map of named getters.

public
public
public

invalidators: Object<Function>

A map of named invalidators.

public

listeners: Object<Function>

A map of named change handler receivers.

public

mergeDeps: boolean

Merge all dependency types into one Object when being passed to the factory.

public

noCache: boolean

Always call the factory when calling getPath, even if there is an existing value.

public
public
public
public
public

resolving: boolean

public

setters: Object<Function>

A map of named setters.

public

strict: boolean

If true, the factory is NOT called until none of the dependencies are undefined.

Private Members
private

Method Summary

Public Methods
public

getPath(path: *): *

public

async getPathAsync(path: *, timeoutMS: *): *

The same as getPath but asynchronous and will wait for a value.

public

async getValueAsync(timeoutMS: *): *

The same as getValue but asynchronous and will wait for a value.

public

async handleFactoryPromise(factoryPromise: *)

public

resolve(): *

public

resolveDependency(dependency: *): *

public

resolveDependencyMap(dependencyMap: {}): *

Static Public Members

public static DEFAULT_NAME: * source

public static ERROR_MESSAGES: * source

Public Constructors

public constructor(dependencyDeclaration: DependencyDeclaration) source

Params:

NameTypeAttributeDescription
dependencyDeclaration DependencyDeclaration

The DependencyDeclaration to be resolved.

Public Members

public addDependencyChangeHandler: * source

public addDependencyErrorHandler: * source

public addDependencyMapChangeHandlers: * source

public addDependencyMapErrorHandlers: * source

public get dependencies: Object<HashMatrix>: * source

Return:

Object<HashMatrix>

A map of named dependencies.

public set dependencies(value: Object<HashMatrix>) source

public factory(dependencyValues: DependencyDeclaration): * | Promise: Function source

The factory function used to create the value of the dependency.

Return:

* | Promise

The value of the dependency.

public getters: Object<Function> source

A map of named getters. getter(path = ''):*

public handleDependencyChange: * source

public handleDependencyError: * source

public invalidators: Object<Function> source

A map of named invalidators. invalidator(subPath = '')

public listeners: Object<Function> source

A map of named change handler receivers. listen(handler):Function (unlisten)

public mergeDeps: boolean source

Merge all dependency types into one Object when being passed to the factory. Default: true

public noCache: boolean source

Always call the factory when calling getPath, even if there is an existing value.

public removeDependencyChangeHandler: * source

public removeDependencyErrorHandler: * source

public removeDependencyMapChangeHandlers: * source

public removeDependencyMapErrorHandlers: * source

public resolving: boolean source

public setters: Object<Function> source

A map of named setters. setter(value = *, subPath = '')

public strict: boolean source

If true, the factory is NOT called until none of the dependencies are undefined.

Private Members

private _dependencies: * source

Public Methods

public getPath(path: *): * source

Params:

NameTypeAttributeDescription
path *

Return:

*

public async getPathAsync(path: *, timeoutMS: *): * source

The same as getPath but asynchronous and will wait for a value.

Params:

NameTypeAttributeDescription
path *
timeoutMS *

Return:

*

public async getValueAsync(timeoutMS: *): * source

The same as getValue but asynchronous and will wait for a value.

Params:

NameTypeAttributeDescription
timeoutMS *

Return:

*

public async handleFactoryPromise(factoryPromise: *) source

Params:

NameTypeAttributeDescription
factoryPromise *

public resolve(): * source

Return:

*

public resolveDependency(dependency: *): * source

Params:

NameTypeAttributeDescription
dependency *

Return:

*

public resolveDependencyMap(dependencyMap: {}): * source

Params:

NameTypeAttributeDescription
dependencyMap {}
  • optional
  • default: {}

Return:

*