@lppedd/di-wise-neo - v0.19.0
    Preparing search index...

    Function createType

    • Creates a type token.

      Type Parameters

      • T

      Parameters

      • typeName: string

      Returns Type<T>

      const ISpell = createType<Spell>("Spell");
      container.register(ISpell, {
      useFactory: () => getDefaultSpell(),
      });
    • Creates a type token with a default Provider and optional default registration options.

      Type Parameters

      • T

      Parameters

      Returns ProviderType<T>

      // Notice how we pass in a Provider directly at type creation site
      const ISpell = createType<Spell>("Spell", {
      useFactory: () => getDefaultSpell(),
      });

      container.register(ISpell);