Dependency icon indicating copy to clipboard operation
Dependency copied to clipboard

Nested dependencies

Open enthuan opened this issue 2 years ago • 0 comments

Hello and thank you for this great solution.

I was wondering how you can safely nest dependencies such as in clean architecture

let service = Service()
let usecase = UseCase(service)

Do you have to make the dependency "injected" inside the wrapping object?

struct UseCase {
    @Injected(\.service) var service
}

Some improvement would be to support "scopes" for example to forbid the injection of data services in viewcontrollers. I don't know if it can be easily implemented.

Thanks 👍

enthuan avatar Nov 08 '22 10:11 enthuan