@microsoft/fast-foundation > transient
transient() function
Registers the target
class as a transient dependency; each time the dependency is resolved a new instance will be created.
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. |
T & RegisterSelf<T>
Example
@transient()
class Foo { }