dependency injection setup

Dependency Injection Setup

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "dependency injection setup" with this command: npx skills add willsigmon/sigstack/willsigmon-sigstack-dependency-injection-setup

Dependency Injection Setup

Instructions

Add new services to Leavn's DIContainer:

Create service protocol:

// Services/MyDomain/MyServiceProtocol.swift public protocol MyServiceProtocol { func doSomething() async throws -> Result }

Create implementation:

// Services/MyDomain/MyServiceLive.swift public final class MyServiceLive: MyServiceProtocol { public init() { }

public func doSomething() async throws -> Result {
    // Implementation
}

}

Register in DIContainer:

// For singletons (stateful services): private lazy var _myService = MyServiceLive() var myService: MyServiceProtocol { _myService }

// For factories (stateless services): var myService: MyServiceProtocol { MyServiceLive() }

Use in ViewModels:

let service = DIContainer.shared.myService

Use this skill when: Creating new service, adding dependency, setting up DI, refactoring to protocol-oriented design

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

swiftlint-autofix

No summary provided by upstream source.

Repository SourceNeeds Review
General

bitrise expert

No summary provided by upstream source.

Repository SourceNeeds Review
General

testflight expert

No summary provided by upstream source.

Repository SourceNeeds Review
General

fastlane expert

No summary provided by upstream source.

Repository SourceNeeds Review