Skip to content

Instantly share code, notes, and snippets.

@avin-kavish
Created April 13, 2025 05:38
Show Gist options
  • Select an option

  • Save avin-kavish/3586b3175eb52682e9c6fb485f0a98c5 to your computer and use it in GitHub Desktop.

Select an option

Save avin-kavish/3586b3175eb52682e9c6fb485f0a98c5 to your computer and use it in GitHub Desktop.
interface GitProvider {
download(): Code
}
class ProviderBase {
endpoint: string
}
class GitHubProvider extends ProviderBase implements GitProvider {
download() {}
}
class GitLabProvider extends ProviderBase implements GitProvider {
download() {}
}
class CodeUser {
constructor(private git: GitProvider) {
}
useCode() {
const code = this.git.download()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment