Skip to main content
Version: 2.x

ResolverBuilder.singleton() method

@microsoft/fast-element/di.js > ResolverBuilder > singleton

ResolverBuilder.singleton() method

Creates a resolver that enforces a singleton lifetime.

Signature:

singleton(value: Constructable): Resolver<K>;

Parameters

Parameter

Type

Description

value

Constructable

The type to create and cache the singleton for.

Returns:

Resolver<K>

The resolver.