Skip to main content
Version: 2.x

Factory interface

@microsoft/fast-element/di.js > Factory

Factory interface

Used by the default Resolver to create instances of objects when needed.

Signature:

export interface Factory<T extends Constructable = any> 

Properties

Property

Modifiers

Type

Description

Type

readonly

T

The concrete type this factory creates.

Methods

Method

Description

construct(container, dynamicDependencies)

Constructs an instance of the factory's object.

constructAsync(container, dynamicDependencies)

Constructs an instance of the factory's object, allowing for async resolution of dependencies.

registerTransformer(transformer)

Registers a transformer function to alter the object after instantiation but before returning the final constructed instance.