Skip to content

Instantly share code, notes, and snippets.

@Plnda
Created May 23, 2020 20:33
Show Gist options
  • Save Plnda/f2764ec3cdec272ba8d05b32aa2f5c9e to your computer and use it in GitHub Desktop.
Save Plnda/f2764ec3cdec272ba8d05b32aa2f5c9e to your computer and use it in GitHub Desktop.
/// Public class
public class Dependencies {
/// Will hold all our factories
public var factories: [ObjectIdentifier: Service] = [:]
/// Make sure that our init will stay private so they need to use the provider functionBuilder
private init() { }
/// Make sure that all the dependencies are removed when we deinit
deinit {
factories.removeAll()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment