Skip to main content
Version: 0.1.2

Type Alias: InjectionType

Imported from @react-logic/di

InjectionType<T> = InjectionToken<T> | Class<T>

Anything that can identify a dependency in the DI container — either a concrete class (used as both token and constructor) or an InjectionToken for opaque/value dependencies.

Using a class as a token gives you both the identity and a default implementation in one — inject(MyService) works without any explicit provider registration. InjectionToken is needed when the dependency has no class identity (a config string, a function, a primitive value).

Type Parameters

T

T

The type the token resolves to.