transient() function
@microsoft/fast-element/di.js > transient
transient() function
Registers the target
class as a transient dependency; each time the dependency is resolved a new instance will be created.
Signature:
export declare function transient<T extends Constructable>(target: T & Partial<RegisterSelf<T>>): T & RegisterSelf<T>;
Parameters
Parameter | Type | Description |
---|---|---|
target | T & Partial<RegisterSelf<T>> | The class / constructor function to register as transient. |
Returns:
T & RegisterSelf<T>
Example
@transient()
class Foo { }