Configuration provided to contexts during initialization.

Contexts can:

  • Access the DI container to resolve dependencies
  • Access the logger for logging
  • Access configuration specific to the context
interface ContextConfig {
    container: Container;
    logger: Logger;
    getConfig<T = unknown>(): undefined | T;
}

Methods

Properties

Methods

  • Gets configuration for this context.

    Type Parameters

    • T = unknown

    Returns undefined | T

    The context configuration, or undefined if not set

    const config = contextConfig.getConfig<ProductsConfig>();
    

Properties

container: Container

The dependency injection container.

logger: Logger

The logger instance.