Last active
December 8, 2020 07:12
-
-
Save ronstar/1bd30c03c761f900516e38c7d793b271 to your computer and use it in GitHub Desktop.
Configurable resolve
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func resolve<Service: Configurable>(type: Service.Type, configuration: Service.Configuration) -> Service? { | |
let service = resolve(type: type) // 1 | |
service?.configure(configuration: configuration) // 2 | |
return service | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment