Skip to main content
Version: 2.x

transient() function

@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 &#123; &#125;