Class: Component

Component

Private to junkie internals.

new Component(key, instance, container, containerResolvers)

Captures a component registration with a Container. Instances are created during Container#register calls.
Parameters:
Name Type Argument Description
key String
instance *
container Container
containerResolvers Array.<Resolver> <optional>

Methods


instance()

Obtain the user-provided component instance.
Returns:
Type
*

key()

Obtain the component key.
Returns:
Type
String

resolve(options)

Resolve an instance for this component.
Parameters:
Name Type Description
options Object The optional resolution options.
Returns:
Type
Promise

store()

Obtain the data store for this component.
Returns:
Type
Object

use(resolver)

Use the given resolver middleware.
Parameters:
Name Type Description
resolver String | function The resolver to use. Supplying a String attempts to locate a standard resolver by name. Supplying a Function uses the Function itself as the resolver implementation.
See:
Returns:
this.
Type
Component