You are viewing documentation for a previous version of FAST. The latest version is 3.x. View latest docs →

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

transient() function

Registers the decorated 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>(): typeof transientDecorator;

Returns:

typeof transientDecorator

Example

@transient()
class Foo { }