Skip to content

Instantly share code, notes, and snippets.

@laevandus
Last active April 2, 2022 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/4e4e92b916b44c665e1a3c7233ec0b3b to your computer and use it in GitHub Desktop.
Save laevandus/4e4e92b916b44c665e1a3c7233ec0b3b to your computer and use it in GitHub Desktop.
// Should I use this?
struct Core {
let dataProcessor: any Computable
}
// or should I inject dependencies using generics?
struct Core2<T: Computable> {
let dataProcessor: T
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment