Skip to main content
Version: 0.1.2

Type Alias: Class

Imported from @react-logic/di

Class<T> = () => T

A constructable class with a zero-argument constructor — i.e. something that can be instantiated by the DI container without further input.

The DI container can inject services that take constructor arguments, but those arguments must come from inject() calls inside the constructor body (or from field initializers), not from positional parameters. That's why the type is new () => T and not new (...args: any[]) => T.

Type Parameters

T

T

The instance type the constructor produces.

Returns

T