LazyInjected

@propertyWrapper
public struct LazyInjected<Service>

Injects and resolves a service when accessed for the first time.

  • A wrapped value.

    Declaration

    Swift

    public var wrappedValue: Service { mutating get set }
  • Initializes a new instance of a service lazily.

    Declaration

    Swift

    public init(resolver: Resolver = .main, name: String? = nil)

    Parameters

    resolver

    An instance of Resolver. Defaults to main.

    name

    The name of a service. Defaults to nil.