Is it possible to register service without using extension of Container? #193
lukakilas
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
Yes, use a extension Container {
var moduleAClient: ParameterFactory<URL, APIClient> {
self { ModuleAClient(baseURL: $0) }
}
} Then, to resolve it: let baseURL = <get your base URL>
let client = Container.shared.moduleAClient(baseURL) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my new swiftUI project I'm using modular approach. Each module is framework type. ModuleA needs to receive baseURL from the App.
My question is, if there is a possibility of registering service with other way, except declaring it in extension of Container?
or how should I handle this particular case?
Beta Was this translation helpful? Give feedback.
All reactions