Skip to content

provideValue · Core API

function provideValue<T>(token, useValue): ValueProvider<T>;

Creates a provider for an already constructed value.

The value must match the token type.

Type Parameter

T

Parameter Type Description

token

Token<T>

Token that identifies the value.

useValue

T

Existing value to register.

ValueProvider<T>

A value provider accepted by a container.

provideValue(PORT, 3000);