Function Scoped

  • Decorator for setting the scope of a class when registering.

    Type Parameters

    • This extends object

    Parameters

    Returns ClassDecorator<Constructor<This>>

    ⁤@Scoped(Scope.Container)
    class Wizard {}

    container.register(Wizard);

    // Under the hood
    container.register(
    Wizard,
    {useClass: Wizard},
    {scope: Scope.Container},
    );

    @NO_SIDE_EFFECTS