Skip to content

Instantly share code, notes, and snippets.

@pjwelcome
Created April 15, 2018 13:49
Show Gist options
  • Save pjwelcome/358963baa743065553d5ee229beaa6c7 to your computer and use it in GitHub Desktop.
Save pjwelcome/358963baa743065553d5ee229beaa6c7 to your computer and use it in GitHub Desktop.
extension DepedencyContainer : Registrable {
public func register<T>(depedency: T.Type, implemenation: @escaping () -> T, objectScope: ObjectScope = .graph) {
container.register(depedency, factory: { _ in implemenation() }).inObjectScope(objectScope)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment