Function Provide

  • Class decorator factory. Provides the decorated class to extending classes. Applying the Provide decorator enforces the Provide type which entails the declaration of a static provide property typed as Registration. The magic string assigned to this static property is used by the Provider factory function to get base classes from the Registry.

    Type Parameters

    Returns ((constructor) => void)

    A class constructor decorator.

      • (constructor): void
      • Parameters

        • constructor: V

        Returns void

    Example

    Provide a base class:

    import { Provide, provide } from '@sgrud/core';

    ⁠@Provide()
    export abstract class Base {

    public static readonly [provide] = 'sgrud.example.Base' as const;

    }

    See

Generated using TypeDoc