Skip to main content
Version: 0.1.1

Type Alias: ProviderEntry

Imported from @react-logic/di

ProviderEntry<T> = Provider<T> | Class<T>

An entry in an Injector's provide array.

A bare class is sugar for { provide: Class, useClass: Class } — equivalent to "use this class as both the token and its own implementation". This is the most common case: provide a class, get its instances on demand.

Mix bare classes with full Provider objects freely: provide={[CounterStore, { provide: API_URL, useValue: '/api' }]}.

Type Parameters

T

T = unknown

The type the provider entry resolves to.