Closed hyazel closed 1 year ago
Since they work differently, there's not a direct equivalent. Just make two factories.
var xyzFetching: Factory<XYZFetching> { self { XYZCombinedService() } }
var xyzUpdating: Factory<XYZUpdating> { self { XYZCombinedService() } }
Or, if you prefer
var xyzFetching: Factory<XYZFetching> { self { self.xyzCombined() } }
var xyzUpdating: Factory<XYZUpdating> { self { self.xyzCombined() } }
private var xyzCombined: Factory<XYZCombinedService> { self { XYZCombinedService() }.shared }
I'd use the later version if the combined service needs to be cached.
Ok thanks !
Hello,
I'm currently migrating my code base from
Resolver
toFactory
.I have some registrations that use the same instance for multiple protocols like this :
What would be the equivalent for
Factory
?Thanks a lot !