@axonlabs/core - v0.13.0
    Preparing search index...

    Type Alias Lifecycle

    Lifecycle: "singleton" | "transient" | "scoped"

    A single instance of the service is created and shared thoughout the application's lifetime.

    Usage: Well-suited for services that are expensive to create or if they need to be shared across the application.

    Example:

    • Caching services
    • Logging service
    • Configuration providers

    A new instance of the service is created every time it is requested.

    Usage: Well-suited for lightweight or stateless services (services that don't hold any state between calls).

    Example:

    • A notification service, such an Email sender.

    A single instance of the service is created per scope and reused within that scope.

    Usage: Suitable for services that maintain state within the same request but don't wantto share the state between requests.

    Example:

    • Authentication service that need to verify permissions based on the request context.